createimage.bmx 328 B

123456789101112131415161718192021
  1. ' createimage.bmx
  2. ' creates a 256x1 image with a black to blue color gradient
  3. Const ALPHABITS=$ff000000
  4. Graphics 640,480,32
  5. image=CreateImage(256,1)
  6. map=LockImage(image)
  7. For i=0 To 255
  8. WritePixel(map,i,0,ALPHABITS|i)
  9. Next
  10. UnlockImage(image)
  11. DrawImageRect image,0,0,640,480
  12. DrawText "Blue Color Gradient",0,0
  13. Flip
  14. WaitKey