Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define ALPHA &HC0
- #define RED &H30
- #define GREEN &H0C
- #define BLUE &H03
- dim shared as integer xPos = 0, yPos = 0
- sub plot8bpp(pixel as ubyte)
- dim as integer pixel32
- dim as integer a = 3 - (pixel AND ALPHA) SHR 6
- dim as integer r = (pixel AND RED) SHR 4
- dim as integer g = (pixel AND GREEN) SHR 2
- dim as integer b = (pixel AND BLUE)
- r *= 85 - a*21
- g *= 85 - a*21
- b *= 85 - a*21
- pixel32 = RGB(r, g, b)
- palette pixel, r, g, b
- line(xPos, yPos)-(xPos+10, yPos+10), pixel, BF
- xPos += 10
- if xPos >= 160 then'640 then
- xPos = 0
- yPos += 10
- end if
- end sub
- screenres 640, 480, 8
- #define _ARGB8(_a, _r, _g, _b) (_a SHL 6 OR _r SHL 4 OR _g SHL 2 OR _b)
- 'plot8bpp(_ARGB8(3, 3, 0, 3))
- for x as integer = 0 to 255
- plot8bpp(x)
- 'sleep 50,1
- next x
- 'dim as any ptr pImage = ImageCreate(160, 160)
- 'get (0, 0)-(160, 160), pImage
- 'dim as integer w, h, b, p, d, size
- 'ImageInfo pImage, w, h, b, p, d, size
- 'print w, h, size
- 'put (200, 200), pImage
- 'bsave "Palette.bmp", 0
- sleep
- 'sleep
- 'ImageDestroy(pImage)
- 'screen 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement