draw it : tekenprog

Algemene discussies en vragen omtrent Liberty BASIC programma's. Stuur zoveel mogelijk delen van listings (snippets) in als je hulp wilt.

Moderators: anthonio, Abcott

draw it : tekenprog

Berichtdoor bluatigro » di maart 04, 2014 2:29 pm

dit is n poging tot n tekenprog


Code: Selecteer alles
WindowWidth = DisplayWidth
WindowHeight = DisplayHeight
nomainwin
global mode , pixel , lijn , ellipse , box
global ellipsefill , boxfill , ox , oy , nx , ny
global file$ , size , winx , winy , color$
true = not( false )
winx = WindowWidth
winy = WindowHeight
menu #m , "file" _
        , "new" , [new] _
        , "open" , [open] _
        , "save" , [save] _
        , "save as" , [saveAs] _
        ,|, "exit" , [quit]
menu #m , "tools" _
        , "pixel" , [pixel] _
        , "line" , [line] _
        , "ellipse" , [ellipse] _
        , "ellipse fill" , [ellipsefill] _
        , "box" , [box] _
        , "box fill" , [boxfill] _
        ,|, "color" , [color]
size = 1
pixel = 1
lijn = 2
ellipse = 3
ellipsefill = 4
box = 5
boxfill = 6
color$ = "black"
mode = pixel
open "draw it 1.0" for graphics as #m
  #m "trapclose [quit]"
  #m "when mouseMove [move]"
  #m "when leftButtonDown [leftdown]"
  #m "when leftButtonMove [leftmove]"
  #m "when leftButtonUp [leftup]"
  #m "setfocus"
wait
[move]
  ox = mouseX
  oy = mouseY
wait
[leftmove]
  nx = mouseX
  ny = mouseY
  if mode = pixel then
    #m "size ";size
    #m "goto ";nx;" ";ny
    #m "down"
    #m "set ";nx;" ";ny
    #m "up"
  end if
wait
[leftdown]
  ox = mouseX
  oy = mouseY
wait
[leftup]
  #m "color ";color$
  #m "backcolor ";color$
  #m "size ";size
  select case mode
    case lijn
      #m "down"
      #m "line ";ox;" ";oy;" ";nx;" ";ny
      #m "up"
    case ellipse
      #m "goto ";ox;" ";oy
      #m "down"
      #m "ellipse ";nx-ox;" ";ny-oy
      #m "up"
    case ellipsefill
      #m "goto ";ox;" ";oy
      #m "down"
      #m "ellipsefilled ";nx-ox;" ";ny-oy
      #m "up"
    case box
      #m "goto ";ox;" ";oy
      #m "down"
      #m "box ";nx;" ";ny
      #m "up"
    case boxfill
      #m "goto ";ox;" ";oy
      #m "down"
      #m "boxfilled ";nx;" ";ny
      #m "up"
    case else
  end select
wait
[pixel]
  prompt "size = " ; s$
  size = val( s$ )
  mode = pixel
wait
[line]
  prompt "size = " ; s$
  size = val( s$ )
  mode = lijn
wait
[ellipse]
  prompt "size = " ; s$
  size = val( s$ )
  mode = ellipse
wait
[ellipsefill]
  mode = ellipsefill
wait
[box]
  prompt "size = " ; s$
  size = val( s$ )
  mode = box
wait
[boxfill]
  mode = boxfill
wait
[color]
  prompt "Color = " ; color$
wait
[new]
  file$ = DefaultDir$ + "\unnamed.bmp"
  #m "fill white"
wait
[open]
  filedialog "open bmp" , "*.bmp" , file$
  loadbmp "drawing" , file$
  #m "background drawing"
wait
[saveAs]
  filedialog "save bmp" , "*.bmp" , file$
[save]
  #m "getbmp drawing 0 0 " ; winx ; " " ; winy
  bmpsave "drawing" , file$
wait
[quit]
  close #m
end
bluatigro
 
Berichten: 306
Geregistreerd: za sep 27, 2008 6:01 pm

Re: draw it : tekenprog

Berichtdoor bluatigro » vr maart 07, 2014 10:53 am

update :
- je tekend r nu sprites mee
- n poging tot rubber band

error :
- [drawit] maakt t scherm helmaal schoon
- rubber band bijft zichtbaar

Code: Selecteer alles
WindowWidth = DisplayWidth
WindowHeight = DisplayHeight
nomainwin
global mode , pixel , lijn , ellipse , box , sprx , spry
global ellipsefill , boxfill , ox , oy , nx , ny
global file$ , size , winx , winy , color$
winx = WindowWidth
winy = WindowHeight
sprx = 100
spry = 100
menu #m , "file" _
        , "new" , [new] _
        , "open" , [open] _
        , "save" , [save] _
        , "save as" , [saveAs] _
        , "draw it" , [drawit] _
        ,|, "exit" , [quit]
menu #m , "tools" _
        , "pixel" , [pixel] _
        , "line" , [line] _
        , "ellipse" , [ellipse] _
        , "ellipse fill" , [ellipsefill] _
        , "box" , [box] _
        , "box fill" , [boxfill] _
        ,|, "color" , [color]
size = 1
pixel = 1
lijn = 2
ellipse = 3
ellipsefill = 4
box = 5
boxfill = 6
color$ = "black"
mode = pixel
open "sprite it 1.0" for graphics as #m
  #m "trapclose [quit]"
  #m "when mouseMove [move]"
  #m "when leftButtonDown [leftdown]"
  #m "when leftButtonMove [leftmove]"
  #m "when leftButtonUp [leftup]"
  #m "setfocus"
wait
[move]
  ox = MouseX
  oy = MouseY
wait
[leftmove]
  nx = MouseX
  ny = MouseY
  #m "rule " ; _R2_NOTXORPEN
  #m "color black"
  #m "size 1"
  select case mode
    case lijn
      #m "down"
      #m "line ";ox;" ";oy;" ";nx;" ";ny
      #m "up"
    case ellipse
      #m "goto ";(ox+nx)/2;" ";(oy+ny)/2
      #m "down"
      #m "ellipse ";nx-ox;" ";ny-oy
      #m "up"
    case ellipsefill
      #m "goto ";(ox+nx)/2;" ";(oy+ny)/2
      #m "down"
      #m "ellipse ";nx-ox;" ";ny-oy
      #m "up"
    case box
      #m "goto ";ox;" ";oy
      #m "down"
      #m "box ";nx;" ";ny
      #m "up"
    case boxfill
      #m "goto ";ox;" ";oy
      #m "down"
      #m "box ";nx;" ";ny
      #m "up"
    case else
      #m "rule ";_R2_COPYPEN
      #m "color ";color$
      #m "size ";size
      #m "goto ";nx;" ";ny
      #m "down"
      #m "set ";nx;" ";ny
      #m "up"
      #m "color black"
      #m "goto ";nx;" ";ny-spry
      #m "down"
      #m "set ";nx;" ";ny-spry
      #m "up"
  end select
wait
[leftdown]
  nx = MouseX
  ny = MouseY
wait
[leftup]
  #m "rule ";_R2_COPYPEN
  #m "color ";color$
  #m "backcolor ";color$
  #m "size ";size
  select case mode
    case lijn
      #m "down"
      #m "line ";ox;" ";oy;" ";nx;" ";ny
      #m "up"
      #m "color black"
      #m "down"
      #m "line ";ox;" ";oy-spry;" ";nx;" ";ny-spry
      #m "up"
    case ellipse
      #m "goto ";(ox+nx)/2;" ";(oy+ny)/2
      #m "down"
      #m "ellipse ";nx-ox;" ";ny-oy
      #m "up"
      #m "color black"
      #m "backcolor black"
      #m "goto ";(ox+nx)/2;" ";(oy+ny)/2-spry
      #m "down"
      #m "ellipse ";nx-ox;" ";ny-oy
      #m "up"
    case ellipsefill
      #m "goto ";(ox+nx)/2;" ";(oy+ny)/2
      #m "down"
      #m "ellipsefilled ";nx-ox;" ";ny-oy
      #m "up"
      #m "color black"
      #m "backcolor black"
      #m "goto ";(ox+nx)/2;" ";(oy+ny)/2-spry
      #m "down"
      #m "ellipsefilled ";nx-ox;" ";ny-oy
      #m "up"
    case box
      #m "goto ";ox;" ";oy
      #m "down"
      #m "box ";nx;" ";ny
      #m "up"
      #m "color black"
      #m "backcolor black"
      #m "goto ";ox;" ";oy-spry
      #m "down"
      #m "box ";nx;" ";ny-spry
      #m "up"
    case boxfill
      #m "goto ";ox;" ";oy
      #m "down"
      #m "boxfilled ";nx;" ";ny
      #m "up"
      #m "color black"
      #m "backcolor black"
      #m "goto ";ox;" ";oy-spry
      #m "down"
      #m "box ";nx;" ";ny-spry
      #m "up"
    case else
  end select
wait
[pixel]
  prompt "size = " ; s$
  size = val( s$ )
  mode = pixel
wait
[line]
  prompt "size = " ; s$
  size = val( s$ )
  mode = lijn
wait
[ellipse]
  prompt "size = " ; s$
  size = val( s$ )
  mode = ellipse
wait
[ellipsefill]
  mode = ellipsefill
wait
[box]
  prompt "size = " ; s$
  size = val( s$ )
  mode = box
wait
[boxfill]
  mode = boxfill
wait
[color]
  prompt "Color = " ; color$
wait
[new]
  file$ = DefaultDir$ + "\unnamed.bmp"
  x$ = "100"
  prompt "Sprite X size =";x$
  sprx = val( x$ )
  y$ = "100"
  prompt "Sprite Y size =";y$
  spry = val( y$ )
  #m "fill white"
  #m "goto 0 ";spry
  #m "color black"
  #m "backcolor black"
  #m "down"
  #m "boxfilled ";sprx;" ";spry*2
  #m "up"
  notice "Draw only in black rect ."
wait
[open]
  filedialog "open bmp" , "*.bmp" , file$
  loadbmp "drawing" , file$
  #m "background drawing"
wait
[saveAs]
  filedialog "save bmp" , "*.bmp" , file$
[save]
  #m "getbmp drawing 0 0 " ;sprx;" ";spry*2
  bmpsave "drawing" , file$
wait
[drawit]
  #m "flush"
  #m "getbmp bmp 0 0 ";sprx;" ";spry*2
  #m "addsprite spr bmp"
  #m "spritexy spr ";winx-sprx*2;" 0"
  #m "spritescale spr 200"
 #m "drawsprites"
'wait
[quit]
  close #m
end
bluatigro
 
Berichten: 306
Geregistreerd: za sep 27, 2008 6:01 pm

Re: draw it : tekenprog

Berichtdoor bluatigro » vr maart 07, 2014 11:45 am

update :
- rubber band !!

instrukties :
- kies new in menu
- typ grootte x en grootte y in prompts
- teken in zwarte rect
- save sprite

error :
- [drawit] maakt t scherm schoon

Code: Selecteer alles
WindowWidth = DisplayWidth
WindowHeight = DisplayHeight
nomainwin
global mode , pixel , lijn , ellipse , box , sprx , spry
global ellipsefill , boxfill , ox , oy , nx , ny
global file$ , size , winx , winy , color$
winx = WindowWidth
winy = WindowHeight
sprx = 100
spry = 100
menu #m , "file" _
        , "new" , [new] _
        , "open" , [open] _
        , "save" , [save] _
        , "save as" , [saveAs] _
        , "draw it" , [drawit] _
        ,|, "exit" , [quit]
menu #m , "tools" _
        , "pixel" , [pixel] _
        , "line" , [line] _
        , "ellipse" , [ellipse] _
        , "ellipse fill" , [ellipsefill] _
        , "box" , [box] _
        , "box fill" , [boxfill] _
        ,|, "color" , [color]
size = 1
pixel = 1
lijn = 2
ellipse = 3
ellipsefill = 4
box = 5
boxfill = 6
color$ = "black"
mode = pixel
open "sprite it 1.0" for graphics as #m
  #m "trapclose [quit]"
  #m "when mouseMove [move]"
  #m "when leftButtonDown [leftdown]"
  #m "when leftButtonMove [leftmove]"
  #m "when leftButtonUp [leftup]"
  #m "setfocus"
wait
[move]
  ox = MouseX
  oy = MouseY
wait
[leftmove]
  nx = MouseX
  ny = MouseY
  #m "rule " ; _R2_NOTXORPEN
  #m "color black"
  #m "size 1"
  select case mode
    case lijn
      #m "down"
      #m "line ";ox;" ";oy;" ";nx;" ";ny
      #m "up"
      call Pause 40
      #m "down"
      #m "line ";ox;" ";oy;" ";nx;" ";ny
      #m "up"
    case ellipse
      #m "goto ";(ox+nx)/2;" ";(oy+ny)/2
      #m "down"
      #m "ellipse ";nx-ox;" ";ny-oy
      #m "up"
      call Pause 40
      #m "goto ";(ox+nx)/2;" ";(oy+ny)/2
      #m "down"
      #m "ellipse ";nx-ox;" ";ny-oy
      #m "up"
    case ellipsefill
      #m "goto ";(ox+nx)/2;" ";(oy+ny)/2
      #m "down"
      #m "ellipse ";nx-ox;" ";ny-oy
      #m "up"
      call Pause 40
      #m "goto ";(ox+nx)/2;" ";(oy+ny)/2
      #m "down"
      #m "ellipse ";nx-ox;" ";ny-oy
      #m "up"
    case box
      #m "goto ";ox;" ";oy
      #m "down"
      #m "box ";nx;" ";ny
      #m "up"
      call Pause 40
      #m "goto ";ox;" ";oy
      #m "down"
      #m "box ";nx;" ";ny
      #m "up"
    case boxfill
      #m "goto ";ox;" ";oy
      #m "down"
      #m "box ";nx;" ";ny
      #m "up"
      call Pause 40
      #m "goto ";ox;" ";oy
      #m "down"
      #m "box ";nx;" ";ny
      #m "up"
    case else
      #m "rule ";_R2_COPYPEN
      #m "color ";color$
      #m "size ";size
      #m "goto ";nx;" ";ny
      #m "down"
      #m "set ";nx;" ";ny
      #m "up"
      #m "color black"
      #m "goto ";nx;" ";ny-spry
      #m "down"
      #m "set ";nx;" ";ny-spry
      #m "up"
  end select
wait
sub Pause ms
  t=time$("milliseconds")
  while time$("milliseconds")<t+ms
  wend
end sub
[leftdown]
  nx = MouseX
  ny = MouseY
wait
[leftup]
  #m "rule ";_R2_COPYPEN
  #m "color ";color$
  #m "backcolor ";color$
  #m "size ";size
  select case mode
    case lijn
      #m "down"
      #m "line ";ox;" ";oy;" ";nx;" ";ny
      #m "up"
      #m "color black"
      #m "down"
      #m "line ";ox;" ";oy-spry;" ";nx;" ";ny-spry
      #m "up"
    case ellipse
      #m "goto ";(ox+nx)/2;" ";(oy+ny)/2
      #m "down"
      #m "ellipse ";nx-ox;" ";ny-oy
      #m "up"
      #m "color black"
      #m "backcolor black"
      #m "goto ";(ox+nx)/2;" ";(oy+ny)/2-spry
      #m "down"
      #m "ellipse ";nx-ox;" ";ny-oy
      #m "up"
    case ellipsefill
      #m "goto ";(ox+nx)/2;" ";(oy+ny)/2
      #m "down"
      #m "ellipsefilled ";nx-ox;" ";ny-oy
      #m "up"
      #m "color black"
      #m "backcolor black"
      #m "goto ";(ox+nx)/2;" ";(oy+ny)/2-spry
      #m "down"
      #m "ellipsefilled ";nx-ox;" ";ny-oy
      #m "up"
    case box
      #m "goto ";ox;" ";oy
      #m "down"
      #m "box ";nx;" ";ny
      #m "up"
      #m "color black"
      #m "backcolor black"
      #m "goto ";ox;" ";oy-spry
      #m "down"
      #m "box ";nx;" ";ny-spry
      #m "up"
    case boxfill
      #m "goto ";ox;" ";oy
      #m "down"
      #m "boxfilled ";nx;" ";ny
      #m "up"
      #m "color black"
      #m "backcolor black"
      #m "goto ";ox;" ";oy-spry
      #m "down"
      #m "box ";nx;" ";ny-spry
      #m "up"
    case else
  end select
wait
[pixel]
  prompt "size = " ; s$
  size = val( s$ )
  mode = pixel
wait
[line]
  prompt "size = " ; s$
  size = val( s$ )
  mode = lijn
wait
[ellipse]
  prompt "size = " ; s$
  size = val( s$ )
  mode = ellipse
wait
[ellipsefill]
  mode = ellipsefill
wait
[box]
  prompt "size = " ; s$
  size = val( s$ )
  mode = box
wait
[boxfill]
  mode = boxfill
wait
[color]
  prompt "Color = " ; color$
wait
[new]
  file$ = DefaultDir$ + "\unnamed.bmp"
  x$ = str$( sprx )
  prompt "Sprite X size =";x$
  sprx = val( x$ )
  y$ = str$( spry )
  prompt "Sprite Y size =";y$
  spry = val( y$ )
  #m "fill white"
  #m "goto 0 ";spry
  #m "color black"
  #m "backcolor black"
  #m "down"
  #m "boxfilled ";sprx;" ";spry*2
  #m "up"
  notice "Draw only in black rect ."
wait
[open]
  filedialog "open bmp" , "*.bmp" , file$
  loadbmp "drawing" , file$
  #m "background drawing"
wait
[saveAs]
  filedialog "save bmp" , "*.bmp" , file$
[save]
  #m "getbmp drawing 0 0 " ;sprx;" ";spry*2
  bmpsave "drawing" , file$
wait
[drawit]
  #m "flush"
  #m "getbmp bmp 0 0 ";sprx;" ";spry*2
  #m "addsprite spr bmp"
  #m "spritexy spr ";winx-sprx*2;" 0"
  #m "spritescale spr 200"
  #m "drawsprites"
wait
[quit]
  close #m
end
bluatigro
 
Berichten: 306
Geregistreerd: za sep 27, 2008 6:01 pm

draw it : sprite tekenprog

Berichtdoor bluatigro » ma aug 24, 2015 1:26 pm

update :
- gum toegevoegd
Code: Selecteer alles
WindowWidth = DisplayWidth
WindowHeight = DisplayHeight
nomainwin
global mode , pixel , lijn , ellipse , box , remove
global ellipsefill , boxfill , ox , oy , nx , ny
global file$ , size , winx , winy , color$ , backolor$
global sprx , spry
winx = WindowWidth
winy = WindowHeight
sprx = 64
spry = 64
menu #m , "file" _
        , "new" , [new] _
        , "open" , [open] _
        , "save" , [save] _
        , "save as" , [saveAs] _
        ,|, "exit" , [quit]
menu #m , "tools" _
        , "pixel" , [pixel] _
        , "line" , [line] _
        , "ellipse" , [ellipse] _
        , "ellipse fill" , [ellipsefill] _
        , "box" , [box] _
        , "box fill" , [boxfill] _
        , "remove" , [remove] _
        ,|, "size" , [size] _
        ,|, "color" , [color] _
        , "backcolor" , [backcolor]
size = 1
pixel = 1
lijn = 2
ellipse = 3
ellipsefill = 4
box = 5
boxfill = 6
remove = 7
color$ = "black"
backcolor$ = "yellow"
mode = pixel
open "draw it sprite" for graphics as #m
  #m "trapclose [quit]"
  #m "when mouseMove [move]"
  #m "when leftButtonDown [leftdown]"
  #m "when leftButtonMove [leftmove]"
  #m "when leftButtonUp [leftup]"
  #m "setfocus"
wait
[move]
  nx = MouseX
  ny = MouseY
wait
[leftmove]
  nx = MouseX
  ny = MouseY
  #m "rule " ; _R2_NOTXORPEN
  #m "color white"
  #m "size 1"
  select case mode
    case lijn
      #m "down"
      #m "line " ; ox ; " " ; oy ; " " ; nx ; " " ; ny
      #m "up"
      #m "down"
      #m "line " ; ox ; " " ; oy ; " " ; nx ; " " ; ny
      #m "up"
    case ellipse
      #m "goto " ; ( ox + nx ) / 2 ; " " ; ( oy + ny ) / 2
      #m "down"
      #m "ellipse " ; nx - ox ; " " ; ny - oy
      #m "up"
      #m "goto " ; ( ox + nx ) / 2 ; " " ; ( oy + ny ) / 2
      #m "down"
      #m "ellipse " ; nx - ox ; " " ; ny - oy
      #m "up"
    case ellipsefill
      #m "goto " ; ( ox + nx ) / 2 ; " " ; ( oy + ny ) / 2
      #m "down"
      #m "ellipse " ; nx - ox ; " " ; ny - oy
      #m "up"
      #m "goto " ; ( ox + nx ) / 2 ; " " ; ( oy + ny ) / 2
      #m "down"
      #m "ellipse " ; nx - ox ; " " ; ny - oy
      #m "up"
    case box
      #m "goto " ; ox ; " " ; oy
      #m "down"
      #m "box " ; nx ; " " ; ny
      #m "up"
      #m "goto " ; ox ; " " ; oy
      #m "down"
      #m "box " ; nx ; " " ; ny
      #m "up"
    case boxfill
      #m "goto " ; ox ; " " ; oy
      #m "down"
      #m "box " ; nx ; " " ; ny
      #m "up"
      #m "goto " ; ox ; " " ; oy
      #m "down"
      #m "box " ; nx ; " " ; ny
      #m "up"
    case pixel
      #m "rule " ; _R2_COPYPEN
      #m "color black"
      #m "size " ; size
      #m "goto " ; nx ; " " ; ny - spry
      #m "down"
      #m "set " ; nx ; " " ; ny - spry
      #m "up"
      #m "color " ; color$
      #m "size " ; size
      #m "goto " ; nx ; " " ; ny
      #m "down"
      #m "set " ; nx ; " " ; ny
      #m "up"
     case else ''remove
      #m "rule " ; _R2_COPYPEN
      #m "color white"
      #m "size " ; size
      #m "goto " ; nx ; " " ; ny - spry
      #m "down"
      #m "set " ; nx ; " " ; ny - spry
      #m "up"
      #m "color black"
      #m "size " ; size
      #m "goto " ; nx ; " " ; ny
      #m "down"
      #m "set " ; nx ; " " ; ny
      #m "up"
  end select
wait
sub Pause ms
  t = time$( "milliseconds" )
  while time$( "milliseconds" ) < t + ms
  wend
end sub
[leftdown]
  ox = MouseX
  oy = MouseY
wait
[leftup]
  #m "rule " ; _R2_COPYPEN
  #m "size " ; size
  select case mode
    case lijn
      #m "color black"
      #m "down"
      #m "line " ; ox ; " " ; oy - spry _
      ; " " ; nx ; " " ; ny - spry
      #m "up"
      #m "color " ; color$
      #m "backcolor " ; backcolor$
      #m "down"
      #m "line " ; ox ; " " ; oy ; " " ; nx ; " " ; ny
      #m "up"
    case ellipse
      #m "color black"
      #m "goto " ; ( ox + nx ) / 2 _
      ; " " ; ( oy + ny ) / 2 - spry
      #m "down"
      #m "ellipse " ; nx - ox ; " " ; ny - oy
      #m "up"
      #m "color " ; color$
      #m "backcolor " ; backcolor$
      #m "goto " ; ( ox + nx ) / 2 ; " " ; ( oy + ny ) / 2
      #m "down"
      #m "ellipse " ; nx - ox ; " " ; ny - oy
      #m "up"
    case ellipsefill
      #m "color black"
      #m "backcolor black"
      #m "goto " ; ( ox + nx ) / 2 _
      ; " " ; ( oy + ny ) / 2 - spry
      #m "down"
      #m "ellipsefilled " ; nx - ox ; " " ; ny - oy
      #m "up"
      #m "color " ; color$
      #m "backcolor " ; backcolor$
      #m "goto " ; ( ox + nx ) / 2 ; " " ; ( oy + ny ) / 2
      #m "down"
      #m "ellipsefilled " ; nx - ox ; " " ; ny - oy
      #m "up"
    case box
      #m "color black"
      #m "goto " ; ox ; " " ; oy - spry
      #m "down"
      #m "box " ; nx ; " " ; ny - spry
      #m "up"     
      #m "color " ; color$
      #m "goto " ; ox ; " " ; oy
      #m "down"
      #m "box " ; nx ; " " ; ny
      #m "up"
    case boxfill
      #m "color black"
      #m "backcolor black"
      #m "goto " ; ox ; " " ; oy
      #m "down"
      #m "boxfilled " ; nx ; " " ; ny
      #m "up"     
      #m "color " ; color$
      #m "backcolor " ; backcolor$
      #m "goto " ; ox ; " " ; oy
      #m "down"
      #m "boxfilled " ; nx ; " " ; ny
      #m "up"
    case else
  end select
wait
[pixel]
  mode = pixel
wait
[line]
  mode = lijn
wait
[ellipse]
  mode = ellipse
wait
[ellipsefill]
  mode = ellipsefill
wait
[box]
  mode = box
wait
[boxfill]
  mode = boxfill
wait
[remove]
  mode = remove
wait
[size]
  s$ = str$( size )
  prompt "size = " ; s$
  size = val( s$ )
wait
[color]
  colordialog color$ , color$
wait
[backcolor]
  colordialog backcolor$ , backcolor$
wait
[new]
  file$ = DefaultDir$ + "\unnamed.bmp"
  #m "fill white"
[x]
  x$ = str$( sprx )
  prompt "X size ?" ; x$
  sprx = val( x$ )
  if sprx > winx then goto [x]
[y]
  y$ = str$( spry )
  prompt "Y size ?" ; y$
  spry = val( y$ )
  if spry > winy / 2 then goto [y]
  #m "goto " ; 0 ; " " ; spry + 1
  #m "color black"
  #m "backcolor black"
  #m "down"
  #m "boxfilled " ; spry ; " " ; spry * 2
  #m "up"
wait
[open]
  filedialog "open bmp" , "*.bmp" , file$
  loadbmp "drawing" , file$
  #m "background drawing"
wait
[saveAs]
  filedialog "save bmp" , "*.bmp" , file$
[save]
  #m "getbmp drawing 0 0 " ; sprx ; " " ; spry * 2
  bmpsave "drawing" , file$ + ".bmp"
wait
[quit]
  close #m
end
bluatigro
 
Berichten: 306
Geregistreerd: za sep 27, 2008 6:01 pm


Keer terug naar Liberty BASIC Code

Wie is er online

Gebruikers op dit forum: Geen geregistreerde gebruikers. en 1 gast

cron