I have been strapped for time lately so don't know if I will get everything in that I want to. Here is the latest version of my art pack in case I don't have a chance to update it later.
I have it set for different size canvases just have not actually coded in changing them yet.
brush width affects - pencil, line, box, and circle
floodfill still a little slow for entire canvas.
sync on
set display mode 1024,768,32
dim color(11,15) as dword
type imagepoint
xpos as integer
ypos as integer
endtype
dim color_check(-1) as imagepoint
#constant max_width=800
#constant max_height = 600
global canvas_width=512
global canvas_height=512
global draw_mode as string
global spray_size=12
global brush_size=1
global brush_style=0
global color5
global color6
global undo_level=10
draw_mode="pencil"
color6=rgb(255,255,255)
for a = 0 to 11
for b = 0 to 15
read color(a,b)
next b
next a
for rr = 1 to 8
create bitmap 1,20,20
for a = 0 to 19
for b = 0 to 19
read x
ink x,0
dot b,a
next b:next a
get image rr,0,0,19,19,1
delete bitmap 1
next rr
for rr = 1 to 2
create bitmap 1,10,10
for a = 0 to 9
for b = 0 to 9
read x
ink x,0
dot b,a
next b:next a
get image rr+500,0,0,9,9,1
delete bitmap 1
next rr
ink rgb(212,209,201),0
box 0,0,165,screen height()
ink rgb(255,255,255),0
box 2,2,161,121
lock pixels
global across
global down
across=(screen width()-canvas_width)/2+85
down=((screen height()-10)-canvas_height)/2
for a = across to across+canvas_width
for b = down to down+canvas_height
dot a,b
next b
next a
unlock pixels
for a = 0 to 11
for b = 0 to 15
ink color(a,b),0
box b*10+2,a*10+2,b*10+11,a*10+11
next b
next a
drawing=1
do
ink rgb(212,209,201),0
for a = 0 to 5
box 4+a*25,219,25+a*25,240
next a
box 5,245,160,270
box 99,174,120,195
ink 0,0
select draw_mode
case "pencil"
box 4,219,25,240
endcase
case "flood"
box 29,219,50,240
endcase
case "spray"
box 54,219,75,240
endcase
case "box"
box 79,219,100,240
endcase
case "circle"
box 104,219,125,240
endcase
case "line"
box 129,219,150,240
endcase
endselect
if brush_style=1 then box 99,174,120,195
center text 15,245,str$(brush_size)
center text 65,245,str$(spray_size)
paste image 1,5,220
paste image 2,30,220
paste image 3,55,220
paste image 4,80,220
paste image 5,105,220
paste image 6,130,220
paste image 7,5,400
paste image 8,100,175
paste image 501,5,208
paste image 502,16,208
paste image 501,55,208
paste image 502,66,208
ink color6,0
box 40,170,70,200
ink color5,0
box 2,170,32,200
mx=mousex():my=mousey()
ucm=mouseclick()
if drawing=1 and ucm=0
drawing=0
inc undo_level
if undo_level>30
shift_undo()
undo_level=30
endif
get image undo_level,across,down,across+canvas_width,down+canvas_height,1
endif
if mx>=across and mx<=across+canvas_width and my>=down and my<=down+canvas_height and ucm>0 and ucm<3
if ucm=1 then ink color5,0
if ucm=2 then ink color6,0
if draw_mode="pencil"
if drawing=1
line oldmx,oldmy,mx,my
if brush_size>1
for a=mx-brush_size+1 to mx+brush_size-1
for b = my-brush_size+1 to my+brush_size-1
x1=a:x2=oldmx+(a-mx):y1=b:y2=oldmy+(b-my)
if x1<across then x1=across
if x2<across then x2=across
if y1<down then y1=down
if y2<down then y2=down
if x1>across+canvas_width then x1=across+canvas_width
if x2>across+canvas_width then x2=across+canvas_width
if y1>down+canvas_height then y1=down+canvas_height
if y2>down+canvas_height then y2=down+canvas_height
if brush_style=1
if a>mx
ink color6,0
else
ink color5,0
endif
endif
line x1,y1,x2,y2
next b: next a
endif
endif
for a = mx-brush_size+1 to mx+brush_size-1
for b = my-brush_size+1 to my+brush_size-1
if a>=across and a<=across+canvas_width and b>=down and b<=down+canvas_height
dot a,b
endif
next b:next a
oldmx=mx:oldmy=my:drawing=1
endif
if draw_mode="flood"
color_test=point(mx,my)
if ucm=1
if color_test<>color5 then flood(mx,my,color5,color_test)
else
if color_test<>color6 then flood(mx,my,color6,color_test)
endif
drawing=1
repeat
until mouseclick()=0
endif
if draw_mode="spray"
where=rnd(359)
rad=rnd(spray_size)
newx=newxvalue(mx,where,rad)
newy=newzvalue(my,where,rad)
if newx>=across and newx<=across+canvas_width and newy>=down and newy<=down+canvas_height then dot newx,newy
drawing=1
endif
if draw_mode="box"
make_box(mx,my,ucm,0)
drawing=1
endif
if draw_mode="line"
make_line(mx,my,ucm,0)
drawing=1
endif
if draw_mode="circle"
make_circle(mx,my,ucm,0)
add_undo()
ink 0,0
box 170,0,screen width(),screen height()
paste image undo_level,across,down
endif
endif
test_buttons()
if keystate(29)=1 and keystate(44)=1 and undo_level>10 and image exist(undo_level-1)
paste image undo_level-1,across,down
dec undo_level
delete image undo_level+1
repeat
until scancode()=0
endif
sync
loop
`palette
data 16777215,5063201,4672801,3624225,2575649,2182444,2182460,2182476,2178381,2174285,2498893,3613005,4661581,5054786,5054770,5054754
data 5713687,5719831,5199639,3626775,2053911,1529638,1529663,1529687,1523799,1517399,1972055,3544919,5183319,5707592,5707568,5707544
data 6433804,6441996,5792268,3629580,1532428,811553,811585,811618,803426,795234,1444962,3542114,5639266,6425678,6425645,6425613
data 7153921,7164417,6319361,3632385,1010945,93467,93508,93548,83309,73069,917869,3539309,6160749,7143763,7143723,7143683
data 10052419,10060611,9410883,7248195,5151043,4430168,4430200,4430233,4422041,4413849,5063577,7160729,9257881,10044293,10044260,10044228
data 11492909,11505197,10465069,7253805,4108077,2993997,2994045,2994094,2981807,2969519,3943855,7155119,10300847,11480464,11480416,11480367
data 12867608,12884248,11519000,3064856,7324696,1623106,1623171,1623235,1607108,1590468,2889924,7084228,11344068,12851355,12851291,12851226
data 14308098,14328834,12573186,7330306,2021890,186935,187016,187096,166874,146138,1770202,7078618,12321498,14287527,14287446,14287365
data 14325872,14335856,13490800,10869360,8313456,7395978,7396018,7396057,7386074,7375834,8155354,10776794,13332698,14315713,14315673,14315634
data 15504222,15517790,14347358,10873950,7466078,6220929,6220982,6221035,6207724,6194156,7298796,10772204,14180076,15490762,15490709,15490656
data 16617293,16634189,15269197,10943821,6618445,5111160,5111226,5111292,5094653,5077757,6376957,10702333,15027709,16600531,16600465,16600399
data 12566463,11711154,10921638,10066329,9211020,8421504,7566195,6710886,5855577,5000268,4210752,3355443,2500134,1710618,855309,0
`penciltool
data 13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,13947080
data 16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080
data 13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,0,0,0,16777215,13947080,16777215,13947080,16777215,13947080,13947080
data 16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,0,12517376,12517376,12517376,0,16777215,13947080,16777215,13947080,16777215,13947080
data 13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,0,12517376,16777215,16777215,0,13947080,16777215,13947080,16777215,13947080,13947080
data 16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,0,0,12517376,16777215,0,13947080,16777215,13947080,16777215,13947080,16777215,13947080
data 13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,0,12636233,0,0,0,16777215,13947080,16777215,13947080,16777215,13947080,13947080
data 16777215,13947080,16777215,13947080,16777215,13947080,16777215,0,12636233,11649842,10465069,0,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080
data 13947080,16777215,13947080,16777215,13947080,16777215,13947080,0,12636233,11649842,0,0,13947080,16777215,13947080,16777215,13947080,16777215,13947080,13947080
data 16777215,13947080,16777215,13947080,16777215,13947080,0,12636233,11649842,10465069,0,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080
data 13947080,16777215,13947080,16777215,13947080,16777215,0,11649842,10465069,0,0,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,13947080
data 16777215,13947080,16777215,13947080,16777215,0,12636233,11649842,10465069,0,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080
data 13947080,16777215,13947080,16777215,13947080,0,0,10465069,0,0,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,13947080
data 16777215,13947080,16777215,13947080,16777215,0,0,0,0,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080
data 13947080,16777215,13947080,16777215,13947080,0,0,0,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,13947080
data 16777215,13947080,16777215,13947080,16777215,0,0,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080
data 13947080,16777215,13947080,16777215,13947080,0,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,13947080
data 16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080
data 13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,13947080
data 16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080
`Fill Tool
data 13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215
data 16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080
data 13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215
data 16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080
data 13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,4193787,4193787,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215
data 16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,4193787,16777215,4193787,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080
data 13947080,16777215,13947080,16777215,11344068,11344068,9704872,16777215,4193787,16777215,16777215,16777215,4193787,4193787,13947080,16777215,13947080,16777215,13947080,16777215
data 16777215,13947080,16777215,11344068,9704872,9704872,12632256,175274,16777215,16777215,16777215,4193787,16777215,16777215,4193787,13947080,16777215,13947080,16777215,13947080
data 13947080,16777215,11344068,9704872,9704872,12632256,175274,11344068,11344068,11344068,175274,11344068,11344068,0,0,4193787,13947080,16777215,13947080,16777215
data 16777215,13947080,11344068,9704872,12632256,175274,11344068,11344068,11344068,175274,11344068,11344068,0,0,0,0,4193787,13947080,16777215,13947080
data 13947080,16777215,11344068,9704872,12632256,175274,175274,11344068,175274,11344068,11344068,0,0,0,0,0,9704872,4193787,13947080,16777215
data 16777215,13947080,11344068,9704872,9704872,13947080,16777215,175274,11344068,11344068,0,0,0,0,0,11344068,9704872,4193787,16777215,13947080
data 13947080,16777215,11344068,11344068,9704872,16777215,13947080,175274,11344068,0,0,0,0,0,11344068,9704872,175274,16777215,13947080,16777215
data 16777215,13947080,11344068,11344068,9704872,13947080,16777215,13947080,175274,0,0,0,0,11344068,9704872,175274,16777215,13947080,16777215,13947080
data 13947080,16777215,11344068,11344068,9704872,16777215,13947080,16777215,13947080,175274,0,0,11344068,9704872,175274,16777215,13947080,16777215,13947080,16777215
data 16777215,13947080,16777215,11344068,9704872,13947080,16777215,13947080,16777215,13947080,175274,9704872,9704872,175274,16777215,13947080,16777215,13947080,16777215,13947080
data 13947080,16777215,13947080,11344068,9704872,16777215,13947080,16777215,13947080,16777215,13947080,175274,175274,16777215,13947080,16777215,13947080,16777215,13947080,16777215
data 16777215,13947080,16777215,13947080,9704872,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080
data 13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215
data 16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080
`Spray Tool
data 16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080
data 13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215
data 16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080
data 13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215
data 16777215,13947080,16777215,13947080,16777215,32768,16777215,32768,16777215,13947080,191,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080
data 13947080,16777215,13947080,16777215,32768,12632256,65280,32768,191,191,191,0,0,0,13947080,16777215,13947080,16777215,13947080,16777215
data 16777215,13947080,16777215,65280,12632256,65280,12632256,65280,16777215,0,0,16777215,16777215,0,0,13947080,16777215,13947080,16777215,13947080
data 13947080,16777215,13947080,16777215,65280,12632256,32768,16777215,13947080,0,16777215,16777215,0,0,16711680,0,13947080,16777215,13947080,16777215
data 16777215,13947080,16777215,32768,12632256,65280,16777215,13947080,16777215,0,16777215,0,0,16711680,16711680,16711680,0,13947080,16777215,13947080
data 13947080,16777215,13947080,16777215,32768,12632256,65280,16777215,13947080,0,0,0,8388608,0,16711680,16711680,16711680,0,13947080,16777215
data 16777215,13947080,16777215,65280,12632256,32768,16777215,13947080,16777215,13947080,0,0,0,8388608,0,16711680,16711680,16711680,0,13947080
data 13947080,16777215,13947080,16777215,65280,16777215,13947080,16777215,13947080,16777215,13947080,0,0,0,8388608,0,16711680,16711680,0,16777215
data 16777215,13947080,16777215,32768,12632256,65280,16777215,13947080,16777215,13947080,16777215,13947080,0,0,0,8388608,0,0,16777215,13947080
data 13947080,16777215,13947080,16777215,32768,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,0,0,0,0,16777215,13947080,16777215
data 16777215,13947080,16777215,65280,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,0,0,16777215,13947080,16777215,13947080
data 13947080,16777215,13947080,16777215,32768,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215
data 16777215,13947080,16777215,65280,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080
data 13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215
data 16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080
data 13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215
`box
data 16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080
data 13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215
data 16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080
data 13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215
data 16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080
data 13947080,16777215,13947080,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,13947080,16777215
data 16777215,13947080,16777215,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,16777215,13947080
data 13947080,16777215,13947080,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,13947080,16777215
data 16777215,13947080,16777215,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,16777215,13947080
data 13947080,16777215,13947080,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,13947080,16777215
data 16777215,13947080,16777215,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,16777215,13947080
data 13947080,16777215,13947080,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,13947080,16777215
data 16777215,13947080,16777215,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,16777215,13947080
data 13947080,16777215,13947080,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,13947080,16777215
data 16777215,13947080,16777215,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,16777215,13947080
data 13947080,16777215,13947080,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,13947080,16777215
data 16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080
data 13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215
data 16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080
data 13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215
`circle
data 16777215,16777215,16777215,16777215,16777215,16777215,16777215,16777215,16777215,16777215,16777215,16777215,16777215,16777215,16777215,16777215,16777215,16777215,16777215,16777215
data 16777215,16777215,16777215,16777215,16777215,16777215,16777215,0,0,0,0,0,16777215,16777215,16777215,16777215,16777215,16777215,16777215,16777215
data 16777215,16777215,16777215,16777215,16777215,0,0,16777215,16777215,16777215,16777215,16777215,0,0,16777215,16777215,16777215,16777215,16777215,16777215
data 16777215,16777215,16777215,16777215,0,16777215,16777215,16777215,16777215,16777215,16777215,16777215,16777215,16777215,0,16777215,16777215,16777215,16777215,16777215
data 16777215,16777215,16777215,0,16777215,16777215,16777215,16777215,16777215,16777215,16777215,16777215,16777215,16777215,16777215,0,16777215,16777215,16777215,16777215
data 16777215,16777215,0,16777215,16777215,16777215,16777215,16777215,16777215,16777215,16777215,16777215,16777215,16777215,16777215,16777215,0,16777215,16777215,16777215
data 16777215,16777215,0,16777215,16777215,16777215,16777215,16777215,16777215,16777215,16777215,16777215,16777215,16777215,16777215,16777215,0,16777215,16777215,16777215
data 16777215,0,16777215,16777215,16777215,16777215,16777215,16777215,16777215,16777215,16777215,16777215,16777215,16777215,16777215,16777215,16777215,0,16777215,16777215
data 16777215,0,16777215,16777215,16777215,16777215,16777215,16777215,16777215,16777215,16777215,16777215,16777215,16777215,16777215,16777215,16777215,0,16777215,16777215
data 16777215,0,16777215,16777215,16777215,16777215,16777215,16777215,16777215,16777215,16777215,16777215,16777215,16777215,16777215,16777215,16777215,0,16777215,16777215
data 16777215,0,16777215,16777215,16777215,16777215,16777215,16777215,16777215,16777215,16777215,16777215,16777215,16777215,16777215,16777215,16777215,0,16777215,16777215
data 16777215,0,16777215,16777215,16777215,16777215,16777215,16777215,16777215,16777215,16777215,16777215,16777215,16777215,16777215,16777215,16777215,0,16777215,16777215
data 16777215,16777215,0,16777215,16777215,16777215,16777215,16777215,16777215,16777215,16777215,16777215,16777215,16777215,16777215,16777215,0,16777215,16777215,16777215
data 16777215,16777215,0,16777215,16777215,16777215,16777215,16777215,16777215,16777215,16777215,16777215,16777215,16777215,16777215,16777215,0,16777215,16777215,16777215
data 16777215,16777215,16777215,0,16777215,16777215,16777215,16777215,16777215,16777215,16777215,16777215,16777215,16777215,16777215,0,16777215,16777215,16777215,16777215
data 16777215,16777215,16777215,16777215,0,16777215,16777215,16777215,16777215,16777215,16777215,16777215,16777215,16777215,0,16777215,16777215,16777215,16777215,16777215
data 16777215,16777215,16777215,16777215,16777215,0,0,16777215,16777215,16777215,16777215,16777215,0,0,16777215,16777215,16777215,16777215,16777215,16777215
data 16777215,16777215,16777215,16777215,16777215,16777215,16777215,0,0,0,0,0,16777215,16777215,16777215,16777215,16777215,16777215,16777215,16777215
data 16777215,16777215,16777215,16777215,16777215,16777215,16777215,16777215,16777215,16777215,16777215,16777215,16777215,16777215,16777215,16777215,16777215,16777215,16777215,16777215
data 16777215,16777215,16777215,16777215,16777215,16777215,16777215,16777215,16777215,16777215,16777215,16777215,16777215,16777215,16777215,16777215,16777215,16777215,16777215,16777215
`line
data 16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080
data 13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215
data 16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080
data 13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215
data 16777215,13947080,16777215,13947080,0,0,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080
data 13947080,16777215,13947080,16777215,13947080,0,0,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215
data 16777215,13947080,16777215,13947080,16777215,13947080,0,0,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080
data 13947080,16777215,13947080,16777215,13947080,16777215,13947080,0,0,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215
data 16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,0,0,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080
data 13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,0,0,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215
data 16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,0,0,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080
data 13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,0,0,16777215,13947080,16777215,13947080,16777215,13947080,16777215
data 16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,0,0,16777215,13947080,16777215,13947080,16777215,13947080
data 13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,0,0,16777215,13947080,16777215,13947080,16777215
data 16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,0,0,16777215,13947080,16777215,13947080
data 13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,0,0,16777215,13947080,16777215
data 16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,0,0,16777215,13947080
data 13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215
data 16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080
data 13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215
`save
data 16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080,16777215,13947080
data 13947080,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16777215
data 16777215,0,3618815,3618815,3618815,3618815,3618815,3618815,3618815,3618815,3618815,3618815,3618815,3618815,3618815,3618815,3618815,3618815,0,13947080
data 13947080,0,255,16777215,16777215,16777215,16777215,16777215,16777215,16777215,16777215,16777215,255,255,255,255,255,3618815,0,16777215
data 16777215,0,255,16777215,16777215,16777215,16777215,16777215,16777215,16777215,16777215,16777215,255,255,255,255,255,3618815,0,13947080
data 13947080,0,255,16777215,16777215,16777215,16777215,16777215,16777215,16777215,16777215,16777215,255,255,255,255,255,3618815,0,16777215
data 16777215,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,3618815,0,13947080
data 13947080,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,3618815,0,16777215
data 16777215,0,255,255,255,255,255,255,255,0,0,255,255,255,255,255,255,3618815,0,13947080
data 13947080,0,255,255,255,255,255,255,0,0,0,0,255,255,255,255,255,3618815,0,16777215
data 16777215,0,255,255,255,255,255,255,0,0,0,0,255,255,255,255,255,3618815,0,13947080
data 13947080,0,255,255,255,255,255,255,255,0,0,255,255,255,255,255,255,3618815,0,16777215
data 16777215,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,3618815,0,13947080
data 13947080,0,255,255,255,255,255,255,255,8421504,8421504,255,255,255,255,255,255,3618815,0,16777215
data 16777215,0,255,255,255,255,255,255,255,8421504,8421504,255,255,255,255,255,255,3618815,0,13947080
data 13947080,0,255,255,255,255,255,255,255,8421504,8421504,255,255,255,255,255,255,3618815,0,16777215
data 16777215,0,255,255,255,255,255,255,255,8421504,8421504,255,255,255,255,255,255,3618815,0,13947080
data 13947080,0,255,255,255,255,255,255,255,8421504,8421504,255,255,255,255,255,255,3618815,0,16777215
data 16777215,0,255,255,255,255,255,255,255,8421504,8421504,255,255,255,255,255,255,3618815,0,13947080
data 13947080,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16777215
`dual
data 33023,33023,33023,33023,33023,33023,33023,33023,33023,33023,33023,33023,33023,33023,33023,33023,33023,33023,33023,33023
data 33023,33023,33023,33023,33023,33023,33023,33023,33023,33023,33023,33023,33023,33023,33023,33023,33023,33023,33023,33023
data 33023,33023,33023,33023,33023,33023,33023,33023,33023,33023,33023,33023,33023,33023,33023,33023,33023,33023,33023,33023
data 33023,33023,33023,33023,33023,33023,33023,33023,33023,33023,33023,33023,33023,33023,33023,33023,33023,33023,33023,33023
data 33023,33023,33023,33023,33023,33023,33023,33023,33023,33023,33023,33023,33023,33023,33023,33023,33023,33023,33023,33023
data 33023,0,0,0,33023,33023,0,33023,33023,0,33023,33023,0,0,33023,33023,0,33023,33023,33023
data 33023,0,33023,0,0,33023,0,33023,33023,0,33023,0,33023,33023,0,33023,0,33023,33023,33023
data 33023,0,33023,33023,0,33023,0,33023,33023,0,33023,0,33023,33023,0,33023,0,33023,33023,33023
data 33023,0,33023,33023,0,33023,0,33023,33023,0,33023,0,0,0,0,33023,0,33023,33023,33023
data 33023,0,33023,33023,0,33023,0,33023,33023,0,33023,0,33023,33023,0,33023,0,33023,33023,33023
data 33023,0,33023,0,0,33023,0,33023,33023,0,33023,0,33023,33023,0,33023,0,33023,33023,33023
data 33023,0,0,0,33023,33023,33023,0,0,33023,33023,0,33023,33023,0,33023,0,0,0,33023
data 33023,33023,33023,33023,33023,33023,33023,33023,33023,33023,33023,33023,33023,33023,33023,33023,33023,33023,33023,33023
data 33023,33023,33023,33023,33023,33023,33023,33023,33023,33023,33023,33023,33023,33023,33023,33023,33023,33023,33023,33023
data 33023,33023,33023,33023,33023,33023,16711680,16711680,16711680,255,255,255,33023,33023,33023,33023,33023,33023,33023,33023
data 33023,33023,33023,33023,33023,33023,16711680,16711680,16711680,255,255,255,33023,33023,33023,33023,33023,33023,33023,33023
data 33023,33023,33023,33023,33023,33023,16711680,16711680,16711680,255,255,255,33023,33023,33023,33023,33023,33023,33023,33023
data 33023,33023,33023,33023,33023,33023,16711680,16711680,16711680,255,255,255,33023,33023,33023,33023,33023,33023,33023,33023
data 33023,33023,33023,33023,33023,33023,16711680,16711680,16711680,255,255,255,33023,33023,33023,33023,33023,33023,33023,33023
data 33023,33023,33023,33023,33023,33023,33023,33023,33023,33023,33023,33023,33023,33023,33023,33023,33023,33023,33023,33023
`add
data 16711935,16711935,16711935,16711935,16711935,16711935,16711935,16711935,16711935,16711935
data 16711935,8388736,8388736,8388736,8388736,8388736,8388736,8388736,8388736,8388608
data 16711935,8388736,8388736,8388736,16777215,16777215,8388736,8388736,8388736,8388608
data 16711935,8388736,8388736,8388736,16777215,16777215,8388736,8388736,8388736,8388608
data 16711935,8388736,16777215,16777215,16777215,16777215,16777215,16777215,8388736,8388608
data 16711935,8388736,16777215,16777215,16777215,16777215,16777215,16777215,8388736,8388608
data 16711935,8388736,8388736,8388736,16777215,16777215,8388736,8388736,8388736,8388608
data 16711935,8388736,8388736,8388736,16777215,16777215,8388736,8388736,8388736,8388608
data 16711935,8388736,8388736,8388736,8388736,8388736,8388736,8388736,8388736,8388608
data 8388608,8388608,8388608,8388608,8388608,8388608,8388608,8388608,8388608,8388608
`subtract
data 16711935,16711935,16711935,16711935,16711935,16711935,16711935,16711935,16711935,16711935
data 16711935,8388736,8388736,8388736,8388736,8388736,8388736,8388736,8388736,8388608
data 16711935,8388736,8388736,8388736,8388736,8388736,8388736,8388736,8388736,8388608
data 16711935,8388736,8388736,8388736,8388736,8388736,8388736,8388736,8388736,8388608
data 16711935,8388736,16777215,16777215,16777215,16777215,16777215,16777215,8388736,8388608
data 16711935,8388736,16777215,16777215,16777215,16777215,16777215,16777215,8388736,8388608
data 16711935,8388736,8388736,8388736,8388736,8388736,8388736,8388736,8388736,8388608
data 16711935,8388736,8388736,8388736,8388736,8388736,8388736,8388736,8388736,8388608
data 16711935,8388736,8388736,8388736,8388736,8388736,8388736,8388736,8388736,8388608
data 8388608,8388608,8388608,8388608,8388608,8388608,8388608,8388608,8388608,8388608
function test_buttons()
mx=mousex():my=mousey():ucm=mouseclick()
if mx>=5 and mx<=25 and my>=220 and my<=240 and ucm=1 then draw_mode="pencil"
if mx>=30 and mx<=50 and my>=220 and my<=240 and ucm=1 then draw_mode="flood"
if mx>=55 and mx<=75 and my>=220 and my<=240 and ucm=1 then draw_mode="spray"
if mx>=80 and mx<=100 and my>=220 and my<=240 and ucm=1 then draw_mode="box"
if mx>=105 and mx<=125 and my>=220 and my<=240 and ucm=1 then draw_mode="circle"
if mx>=130 and mx<=150 and my>=220 and my<=240 and ucm=1 then draw_mode="line"
if mx>=5 and mx<=15 and my>=208 and my<=218 and brush_size<10 and ucm=1 then inc brush_size:repeat:until mouseclick()=0
if mx>=16 and mx<=26 and my>=208 and my<=218 and brush_size>1 and ucm=1 then dec brush_size:repeat:until mouseclick()=0
if mx>=55 and mx<=65 and my>=208 and my<=218 and spray_size<99 and ucm=1 then inc spray_size:repeat:until mouseclick()=0
if mx>=66 and mx<=76 and my>=208 and my<=218 and spray_size>1 and ucm=1 then dec spray_size:repeat:until mouseclick()=0
if mx>1 and mx<162 and my>1 and my<122 and ucm=1 then color5=point(mx,my)
if mx>1 and mx<162 and my>1 and my<122 and ucm=2 then color6=point(mx,my)
if mx>=100 and mx<=120 and my>=175 and my<=195 and ucm=1
if brush_style=1
brush_style=0
else
brush_style=1
endif
repeat
until mouseclick()=0
endif
if mx>=5 and mx<=25 and my>=400 and my<=420 and ucm=1 then save_image()
endfunction
function shift_undo()
for a = 11 to 30
make memblock from image a,a
next a
for a=11 to 29
make image from memblock a,a+1
delete memblock a+1
next a
endfunction
function flood(xpos,ypos,new,old)
array insert at top color_check()
color_check(0).xpos=xpos
color_check(0).ypos=ypos
lock pixels
ink new,0
dot xpos,ypos
repeat
for a = array count(color_check()) to 0 step -1
curx=color_check(a).xpos
cury=color_check(a).ypos
edge_reached=0
if point(curx-1,cury)=old and curx-1>=across
dot curx-1,cury
array insert at bottom color_check()
color_check(array count(color_check())).xpos=curx-1
color_check(array count(color_check())).ypos=cury
else
inc edge_reached
endif
if point(curx+1,cury)=old and curx+1<=across+canvas_width
dot curx+1,cury
array insert at bottom color_check()
color_check(array count(color_check())).xpos=curx+1
color_check(array count(color_check())).ypos=cury
else
inc edge_reached
endif
if point(curx,cury-1)=old and cury-1>=down
dot curx,cury-1
array insert at bottom color_check()
color_check(array count(color_check())).xpos=curx
color_check(array count(color_check())).ypos=cury-1
else
inc edge_reached
endif
if point(curx,cury+1)=old and cury+1<=down+canvas_height
dot curx,cury+1
array insert at bottom color_check()
color_check(array count(color_check())).xpos=curx
color_check(array count(color_check())).ypos=cury+1
else
inc edge_reached
endif
if edge_reached=4
array delete element color_check(),a
endif
next a
until array count(color_check())<0
unlock pixels
endfunction
function make_box(startx,starty,choice,mode)
repeat
until mouseclick()=0
repeat
paste image undo_level,across,down
if choice=1
ink color5,0
else
ink color6,0
endif
if startx<=mousex()
x1=startx
x2=mousex()
else
x1=mousex()
x2=startx
endif
if starty<=mousey()
y1=starty
y2=mousey()
else
y1=mousey()
y2=starty
endif
if x1<across then x1=across
if x2>across+canvas_width then x2=across+canvas_width
if y1<down then y1=down
if y2>down+canvas_height then y2=down+canvas_height
box x1,y1,x2,y2
if brush_style=1
if choice=1
ink color6,0
else
ink color5,0
endif
if brush_size=1
box x1+brush_size,y1+brush_size,x2-brush_size,y2-brush_size-1
else
box x1+(brush_size-1)*2,y1+(brush_size-1)*2,x2-(brush_size-1)*2,y2-(brush_size-1)*2
endif
endif
sync
until mouseclick()=choice
repeat
until mouseclick()=0
endfunction
function make_line(startx,starty,choice,mode)
linemode=check_for_double()
repeat
repeat
paste image undo_level,across,down
if choice=1
ink color5,0
else
ink color6,0
endif
mx=mousex():my=mousey()
if mx<across then mx=across
if mx>across+canvas_width then mx=across+canvas_width
if my<down then my=down
if my>down+canvas_height then my=down+canvas_height
line startx,starty,mx,my
if brush_size>1
for a=mx-brush_size+1 to mx+brush_size-1
for b = my-brush_size+1 to my+brush_size-1
x1=a:x2=startx+(a-mx):y1=b:y2=starty+(b-my)
if x1<across then x1=across
if x2<across then x2=across
if y1<down then y1=down
if y2<down then y2=down
if x1>across+canvas_width then x1=across+canvas_width
if x2>across+canvas_width then x2=across+canvas_width
if y1>down+canvas_height then y1=down+canvas_height
if y2>down+canvas_height then y2=down+canvas_height
if brush_style=1
if a>mx
ink color6,0
else
ink color5,0
endif
endif
line x1,y1,x2,y2
next b: next a
endif
sync
until mouseclick()=choice
newcheck=check_for_double()
if linemode>0 and newcheck=0
startx=mx:starty=my
add_undo()
else
done=1
endif
until done=1
repeat
until mouseclick()=0
endfunction
function check_for_double()
repeat
until mouseclick()=0
starttime=timer()+100
repeat
if mouseclick()>0 then clicked=1
until starttime<timer() or clicked>0
endfunction clicked
function add_undo()
inc undo_level
if undo_level>30
shift_undo()
undo_level=30
endif
get image undo_level,across,down,across+canvas_width,down+canvas_height,1
endfunction
function make_circle(startx,starty,choice,mode)
get image 800,0,0,170,screen height(),1
repeat
until mouseclick()=0
repeat
ink 0,0
box 171,0,screen width(),screen height()
paste image undo_level,across,down
if choice=1
ink color5,0
else
ink color6,0
endif
mx=mousex():my=mousey()
if mx<across then mx=across
if mx>across+canvas_width then mx=across+canvas_width
if my<down then my=down
if my>down+canvas_height then my=down+canvas_height
rad=abs(startx-mx)
circle startx,starty,rad
if brush_size>1
for circount = 0-brush_size to brush_size
circle startx,starty,rad+circount
circle startx-1,starty-1,rad+circount
circle startx+1,starty+1,rad+circount
circle startx-1,starty+1,rad+circount
circle startx+1,starty-1,rad+circount
if brush_size>2
circle startx+2,starty+2,rad+circount
circle startx-2,starty-2,rad+circount
circle startx-2,starty+2,rad+circount
circle startx+2,starty-2,rad+circount
endif
if brush_style=1
if circount>0
if choice=1
ink color6,0
else
ink color5,0
endif
endif
endif
next circount
endif
paste image 800,0,0
sync
until mouseclick()=choice
repeat
until mouseclick()=0
endfunction
function enter_text(x,y)
word$=""
clear entry buffer
repeat
ink rgb(255,255,255),0
box x,y,x+120,y+20
ink 0,0
x$=entry$(1)
if x$<>""
word$=word$+left$(x$,1)
clear entry buffer
repeat
until scancode()=0
endif
sc=scancode()
if sc=14 and len(word$)>0
word$=left$(word$,len(word$)-1)
repeat
until scancode()=0
endif
text x,y,word$
tl=text width(word$)
if blink=0
ink rgb(255,255,255),0
box x+text width(word$)+2,y,x+text width(word$)+8,y+text height("W")
else
ink rgb(100,100,100),0
box x+text width(word$)+2,y,x+text width(word$)+8,y+text height("W")
endif
if blinkspeed<timer()
if blink=0
blink=1
else
blink=0
endif
blinkspeed=timer()+250
endif
sync
until scancode()=28
repeat
until scancode()=0
ink rgb(212,209,201),0
box x,y,x+140,y+21
ink color5,0
endfunction word$
function save_image()
file$=enter_text(5,500)
file$=file$+".bmp"
if file exist(file$)
delete file file$
endif
save image file$,undo_level
endfunction