title "mew hand paint 1.1"
randomize
screen 0,1024,640
buffer 1,1024,1024
gsel 0
onclick *doclick
prx=0:pry=0//topleft buffer pic
color 200,200,200
boxf
font "",rnd(60)+30
mes "Program by ChanMew"
color 255,255,255
boxf 0,0,15,15
boxf 16,16,271,271
color rnd(255),rnd(255),rnd(255)
pos ginfo_winx-ginfo_mesx,ginfo_winy-ginfo_mesy
mes "Program by ChanMew"
objsize 64,16
pos 16,0
button "save",*save
pos 80,0
button "load",*load
pos 144,0
button "get",*get
pos 208,0
button "put",*put
pos 288,0
objsize 360,15
button "←",*moveleft
pos648,0
button "→",*moveright
pos 1009,16
objsize 15,304
button "↑",*moveup
button "↓",*movedown
pos 16,272
objsize 80,16
button "fill",*fill
button "set bg color",*sbgc
button "line",*drline
x=16
y=336
r=0
g=0
b=0
repeat
color r,g,b
boxf x,y,x+15,y+15
r = r+85:if r=340:r=0:g=g+85:if g=340:g=0:b=b+255:if b=510:break
y=y+16
if y=400:y=336:x=x+16
loop
gosub *placepic
stop
*sbgc
bgr=ginfo_r:bgg=ginfo_g:bgb=ginfo_b
*drline
dline=1
stop
*fill
boxf 16,16,272,272
boxf 0,0,15,15
stop
*movedown
pry=pry+256
if pry>768:pry=768
gosub *placepic
stop
*moveup
pry=pry-256
if pry<0:pry=0
gosub *placepic
stop
*moveleft
prx=prx-256
if prx<0:prx=0
gosub *placepic
stop
*moveright
prx=prx+256
if prx>768:prx=768
gosub *placepic
stop
*get
gmode 0,16,16
pos 0,0
gcopy 1,picx,picy,16,16
goto *stb
stop
*put
gsel 1
gmode 0,16,16
pos picx,picy
gcopy 0,0,0,16,16
gsel 0
gosub *placepic
stop
*save
dialog "bmp|jpg",17,"picture file"
if stat=0:stop
filename=refstr
if strmid(filename,-1,4)!".bmp":filename=filename+".bmp"
gsel 1
bmpsave filename
gsel 0
stop
*load
dialog "bmp|jpg",16,"picture"
if stat=0:stop
gsel 1
picload refstr,0
gsel 0
gosub *placepic
stop
*doclick
i=0:i1=0:i2=0
if iparam=3:i=1:else:i=0
if mousex>16:i1 = 2
if mousex>271:i1 = 0
if mousex>287:i1 = 4
if mousex>1007:i1 = 0
if mousey>16:i2 = 8
if mousey>271:i2 = 32
if mousey>335:i2 = 16
if mousey>623:i2 = 0
i=i+i1+i2
if i=10:goto *draw
if i=18:goto *getcolor
if i=11:goto *clear
if i=19:goto *setcolor
if i1=4&i2>0:goto *selectpic
stop
*selectpic
x=mousex/16
y=mousey/16
picx=prx+x*16-288:picy=pry+y*16-16
x=x*16-1
y=y*16-1
gosub *placepic
stop
*clear
r=ginfo_r:g=ginfo_g:b=ginfo_b
color bgr,bgg,bgb
x=mousex/16
y=mousey/16
boxf x*16,y*16,x*16+15,y*16+15
pset x-1,y-1
color r,g,b
stop
*draw
x=mousex/16
y=mousey/16
boxf x*16,y*16,x*16+15,y*16+15
pset x-1,y-1
if dline=2:line x-1,y-1,linex1,liney1:dline=0:goto *stb
if dline=1:linex1=x-1:liney1=y-1:dline=2
stop
*getcolor
pget mousex,mousey
stop
*setcolor
x=mousex/16
y=mousey/16
dialog "",33
if stat=0:stop
color ginfo_r,ginfo_g,ginfo_b
boxf x*16,y*16,x*16+15,y*16+15
stop
*placepic
pos 288,16
color 200,200,200
boxf 285,10,1010,626
gmode 0,720,606,0
gcopy 1,prx,pry,720,606
color 255,0,0
line picx-prx+304,picy-pry+15,picx-prx+287,picy-pry+15
line picx-prx+304,picy-pry+32
line picx-prx+287,picy-pry+32
line picx-prx+287,picy-pry+15
return
*stb
r=ginfo_r:g=ginfo_g:b=ginfo_b
repeat 16
i=cnt
repeat 16
pget i,cnt
boxf i*16+16,cnt*16+16,i*16+32,cnt*16+32
loop
loop
color r,g,b
stop
randomize
screen 0,1024,640
buffer 1,1024,1024
gsel 0
onclick *doclick
prx=0:pry=0//topleft buffer pic
color 200,200,200
boxf
font "",rnd(60)+30
mes "Program by ChanMew"
color 255,255,255
boxf 0,0,15,15
boxf 16,16,271,271
color rnd(255),rnd(255),rnd(255)
pos ginfo_winx-ginfo_mesx,ginfo_winy-ginfo_mesy
mes "Program by ChanMew"
objsize 64,16
pos 16,0
button "save",*save
pos 80,0
button "load",*load
pos 144,0
button "get",*get
pos 208,0
button "put",*put
pos 288,0
objsize 360,15
button "←",*moveleft
pos648,0
button "→",*moveright
pos 1009,16
objsize 15,304
button "↑",*moveup
button "↓",*movedown
pos 16,272
objsize 80,16
button "fill",*fill
button "set bg color",*sbgc
button "line",*drline
x=16
y=336
r=0
g=0
b=0
repeat
color r,g,b
boxf x,y,x+15,y+15
r = r+85:if r=340:r=0:g=g+85:if g=340:g=0:b=b+255:if b=510:break
y=y+16
if y=400:y=336:x=x+16
loop
gosub *placepic
stop
*sbgc
bgr=ginfo_r:bgg=ginfo_g:bgb=ginfo_b
*drline
dline=1
stop
*fill
boxf 16,16,272,272
boxf 0,0,15,15
stop
*movedown
pry=pry+256
if pry>768:pry=768
gosub *placepic
stop
*moveup
pry=pry-256
if pry<0:pry=0
gosub *placepic
stop
*moveleft
prx=prx-256
if prx<0:prx=0
gosub *placepic
stop
*moveright
prx=prx+256
if prx>768:prx=768
gosub *placepic
stop
*get
gmode 0,16,16
pos 0,0
gcopy 1,picx,picy,16,16
goto *stb
stop
*put
gsel 1
gmode 0,16,16
pos picx,picy
gcopy 0,0,0,16,16
gsel 0
gosub *placepic
stop
*save
dialog "bmp|jpg",17,"picture file"
if stat=0:stop
filename=refstr
if strmid(filename,-1,4)!".bmp":filename=filename+".bmp"
gsel 1
bmpsave filename
gsel 0
stop
*load
dialog "bmp|jpg",16,"picture"
if stat=0:stop
gsel 1
picload refstr,0
gsel 0
gosub *placepic
stop
*doclick
i=0:i1=0:i2=0
if iparam=3:i=1:else:i=0
if mousex>16:i1 = 2
if mousex>271:i1 = 0
if mousex>287:i1 = 4
if mousex>1007:i1 = 0
if mousey>16:i2 = 8
if mousey>271:i2 = 32
if mousey>335:i2 = 16
if mousey>623:i2 = 0
i=i+i1+i2
if i=10:goto *draw
if i=18:goto *getcolor
if i=11:goto *clear
if i=19:goto *setcolor
if i1=4&i2>0:goto *selectpic
stop
*selectpic
x=mousex/16
y=mousey/16
picx=prx+x*16-288:picy=pry+y*16-16
x=x*16-1
y=y*16-1
gosub *placepic
stop
*clear
r=ginfo_r:g=ginfo_g:b=ginfo_b
color bgr,bgg,bgb
x=mousex/16
y=mousey/16
boxf x*16,y*16,x*16+15,y*16+15
pset x-1,y-1
color r,g,b
stop
*draw
x=mousex/16
y=mousey/16
boxf x*16,y*16,x*16+15,y*16+15
pset x-1,y-1
if dline=2:line x-1,y-1,linex1,liney1:dline=0:goto *stb
if dline=1:linex1=x-1:liney1=y-1:dline=2
stop
*getcolor
pget mousex,mousey
stop
*setcolor
x=mousex/16
y=mousey/16
dialog "",33
if stat=0:stop
color ginfo_r,ginfo_g,ginfo_b
boxf x*16,y*16,x*16+15,y*16+15
stop
*placepic
pos 288,16
color 200,200,200
boxf 285,10,1010,626
gmode 0,720,606,0
gcopy 1,prx,pry,720,606
color 255,0,0
line picx-prx+304,picy-pry+15,picx-prx+287,picy-pry+15
line picx-prx+304,picy-pry+32
line picx-prx+287,picy-pry+32
line picx-prx+287,picy-pry+15
return
*stb
r=ginfo_r:g=ginfo_g:b=ginfo_b
repeat 16
i=cnt
repeat 16
pget i,cnt
boxf i*16+16,cnt*16+16,i*16+32,cnt*16+32
loop
loop
color r,g,b
stop