Here's a variation on an airbrush
rem airbrush
rem latch
rem 10/20/2009
sync on
sync rate 0
create bitmap 1,250,220
areatype=0
do
cls
text 0,0,"Press 0 for circle spray"
text 0,20,"Press 1 for ellipse spray"
text 0,40,"Press 2 for rextangular spray"
text 0,60,"UP/DOWN arrows to change y radius"
text 0,80,"LEFT/RIGHT arrows to change x radius"
text 0,100,"SHIFT/CTRL to change spray density"
text 0,120,"Press C to clear the drawing area"
text 0,140,"Current spray type = "+str$(areatype)
text 0,160,"X radius = "+str$(rad1)
text 0,180,"Y radius = "+str$(rad2)
text 0,200,"Density = "+str$(density)
rem spray type
select inkey$()
case "0" : areatype=0 : endcase
case "1" : areatype=1 : endcase
case "2" : areatype=2 : endcase
case "c"
set current bitmap 0
cls 0
set current bitmap 1
endcase
endselect
rem spray size
rad1=rad1+(rightkey()-leftkey())
if rad1<0 then rad1=0
rad2=rad2+(upkey()-downkey())
if rad2<0 then rad2=0
density=density+(shiftkey()-controlkey())
if density < 1 then density=1
if rightkey() or leftkey() or upkey() or downkey() or shiftkey() or controlkey() then wait 50
rem draw
if mouseclick()&1
set current bitmap 0
airbrush(mousex(),mousey(),areatype,rad1,rad2,density)
endif
set current bitmap 1
copy bitmap 1,0
sync
loop
function airbrush(cx,cy,areatype,rad1,rad2,density)
remstart
cx == center x
cy == center y
areatype == 0 = circle
1 = ellipse
2 = rectangular
rad1 == x radius or global radius
rad2 == y radius
density == number of dots per spray
remend
select areatype
case 0
for n=1 to density
r=rnd(rad1)
ang#=rnd(359)+(rnd(1000)/1000.0)
dot r*cos(ang#)+cx,r*sin(ang#)+cy
next n
endcase
case 1
for n=1 to density
ang#=rnd(359)+(rnd(1000)/1000.0)
dot rnd(rad1)*cos(ang#)+cx,rnd(rad2)*sin(ang#)+cy
next n
endcase
case 2
dw=rad1+rad1
dh=rad2+rad2
for n=1 to density
dot cx+(rnd(dw)-rad1),cy+(rnd(dh)-rad2)
next n
endcase
case default
for n=1 to density
r=rnd(rad1)
ang#=rnd(359)+(rnd(1000)/1000.0)
dot r*cos(ang#)+cx,r*sin(ang#)+cy
next n
endcase
endselect
endfunction
Enjoy your day.