Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Detect Current Screen Mode?
#1
Is there a simple means to detect the screen mode being used in a program. I can make my program behave so this is not an issue but I want to make it part of a subroutine I may share with others and just not sure how to do it from within the subroutine alone.
Reply
#2
Code: (Select All)
DATA 0,1,2,7,8,9,10,11,12,13,256,32
DIM mode(11)

FOR i = 0 TO 11
READ mode(i)
NEXT

FOR i = 0 TO 11
IF i < 10 THEN
SCREEN mode(i)
ELSE
SCREEN _NEWIMAGE(640, 400, mode(i))
END IF
PRINT "ACTUAL MODE:"; mode(i)
w = _WIDTH(0)
h = _HEIGHT(0)
bpp = _PIXELSIZE
SELECT CASE bpp
CASE 0 'text screen
PRINT "SCREEN 0"
CASE 1
FOR j = 1 TO 255
IF _PALETTECOLOR(j, 0) = &HFF000000 THEN EXIT FOR
NEXT

SELECT CASE j
CASE 4: PRINT "SCREEN 1"
CASE 2: IF h = 200 THEN PRINT "SCREEN 2" ELSE PRINT "SCREEN 11"
CASE 1: PRINT "SCREEN 10"
CASE 16
IF w = 320 THEN
IF _PALETTECOLOR(17, 0) = &HFF000000 THEN PRINT "SCREEN 7" ELSE PRINT "SCREEN 13"
ELSE
SELECT CASE h
CASE 200: PRINT "SCREEN 8"
CASE 350: PRINT "SCREEN 9"
CASE 480: PRINT "SCREEN 12"
CASE ELSE
PRINT "SCREEN _NEWIMAGE("; w; ","; h; ", 256)"
END SELECT
END IF
END SELECT
CASE 4
PRINT "SCREEN _NEWIMAGE("; w; ","; h; ",32)"
END SELECT
SLEEP
NEXT
Reply
#3
Thanks I was going in with mem to try to check image details and just not sure I was approaching that right. ( i wasn't)
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Mac current release sigabrt BlameTroi 3 218 02-05-2026, 02:26 PM
Last Post: a740g
  Enlarging window for older BAS programs (ie. Screen 7 mode) paulel 5 388 12-24-2025, 09:36 PM
Last Post: paulel
  Detect running from IDE mdijkens 1 579 02-12-2024, 02:59 AM
Last Post: FellippeHeitor
  Detect mouse leaving application's window in pure QB64 TempodiBasic 9 1,842 10-09-2023, 10:44 PM
Last Post: TempodiBasic
  Detect when mouse leaves program window TerryRitchie 25 4,518 09-27-2023, 05:31 AM
Last Post: SMcNeill

Forum Jump:


Users browsing this thread: 1 Guest(s)