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




Users browsing this thread: 1 Guest(s)