Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
66
Task/Bitmap/Action-/bitmap.action
Normal file
66
Task/Bitmap/Action-/bitmap.action
Normal file
|
|
@ -0,0 +1,66 @@
|
|||
INCLUDE "H6:RGBIMAGE.ACT" ;from task Bitmap
|
||||
|
||||
RGB black,yellow,violet,blue
|
||||
|
||||
PROC DrawImage(RgbImage POINTER img BYTE x,y)
|
||||
RGB c
|
||||
BYTE i,j
|
||||
|
||||
FOR j=0 TO img.h-1
|
||||
DO
|
||||
FOR i=0 TO img.w-1
|
||||
DO
|
||||
GetRgbPixel(img,i,j,c)
|
||||
IF RgbEqual(c,yellow) THEN
|
||||
Color=1
|
||||
ELSEIF RgbEqual(c,violet) THEN
|
||||
Color=2
|
||||
ELSEIF RgbEqual(c,blue) THEN
|
||||
Color=3
|
||||
ELSE
|
||||
Color=0
|
||||
FI
|
||||
Plot(x+i,y+j)
|
||||
OD
|
||||
OD
|
||||
RETURN
|
||||
|
||||
PROC Main()
|
||||
RgbImage img
|
||||
BYTE CH=$02FC,width=[80],height=[60]
|
||||
BYTE ARRAY ptr(14400)
|
||||
BYTE i,x,y,c
|
||||
|
||||
Graphics(7+16)
|
||||
SetColor(0,13,12) ;yellow
|
||||
SetColor(1,4,10) ;violet
|
||||
SetColor(2,8,6) ;blue
|
||||
SetColor(4,0,0) ;black
|
||||
|
||||
RgbBlack(black)
|
||||
RgbYellow(yellow)
|
||||
RgbViolet(violet)
|
||||
RgbBlue(blue)
|
||||
|
||||
InitRgbImage(img,width,height,ptr)
|
||||
FillRgbImage(img,blue)
|
||||
|
||||
FOR i=1 TO 1000
|
||||
DO
|
||||
c=Rand(3)
|
||||
x=Rand(width)
|
||||
y=Rand(height)
|
||||
IF c=0 THEN
|
||||
SetRgbPixel(img,x,y,yellow)
|
||||
ELSEIF c=1 THEN
|
||||
SetRgbPixel(img,x,y,violet)
|
||||
ELSE
|
||||
SetRgbPixel(img,x,y,black)
|
||||
FI
|
||||
OD
|
||||
|
||||
DrawImage(img,(160-width)/2,(96-height)/2)
|
||||
|
||||
DO UNTIL CH#$FF OD
|
||||
CH=$FF
|
||||
RETURN
|
||||
Loading…
Add table
Add a link
Reference in a new issue