Grey Scale Bitmaps

From QB64 Wiki
Revision as of 23:56, 5 September 2010 by imported>Clippy (Created page with '{{CodeStart}} '' '' {{Cl|SUB}} True{{Cl|COLOR}}12 'screen 12 ************************greyscale 24 bit {{Cl|IF}} ((Picture{{Cl|WIDTH}}& * 3) {{Cl|MOD}} 4) <> 0 {{Cl|THEN}} ZeroP…')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

SUB TrueCOLOR12 'screen 12 ************************greyscale 24 bit IF ((PictureWIDTH& * 3) MOD 4) <> 0 THEN ZeroPAD$ = SPACE$((4 - ((PictureWIDTH& * 3) MOD 4))) END IF SCREEN 12 n = 3 FOR Colr = 0 TO 15 OUT &H3C8, Colr OUT &H3C9, n OUT &H3C9, n OUT &H3C9, n n = n + 4 NEXT Colr y = PictureDEPTH& - 1 o$ = " " GET #1, OffsetBITS&, o$ a$ = " " B$ = " " c$ = " " DO x = 0 DO GET #1, , a$ GET #1, , B$ GET #1, , c$ a = ASC(a$) B = ASC(B$) c = ASC(c$) d = (a + B + c) \ 48 PSET (x, y), d x = x + 1 LOOP WHILE x < PictureWIDTH& GET #1, , ZeroPAD$ y = y - 1 LOOP UNTIL y = -1 END SUB

SUB TrueCOLOR13 'screen 13*****************greyscale 24 bit IF ((PictureWIDTH& * 3) MOD 4) <> 0 THEN ZeroPAD$ = SPACE$((4 - ((PictureWIDTH& * 3) MOD 4))) END IF SCREEN 13 FOR Colr = 0 TO 255 STEP 4 FOR Reps = 0 TO 3 OUT &H3C8, Colr + Reps OUT &H3C9, n OUT &H3C9, n OUT &H3C9, n NEXT Reps n = n + 1 NEXT Colr y = PictureDEPTH& - 1 o$ = " " GET #1, OffsetBITS&, o$ a$ = " " B$ = " " c$ = " " DO x = 0 DO GET #1, , a$ GET #1, , B$ GET #1, , c$ a = ASC(a$) B = ASC(B$) c = ASC(c$) d = (a + B + c) / 3 PSET (x, y), d x = x + 1 LOOP WHILE x < PictureWIDTH& GET #1, , ZeroPAD$ y = y - 1 LOOP UNTIL y = -1 END SUB


See also:




Navigation:
Keyword Reference - Alphabetical
Keyword Reference - By Usage
Main Wiki Page