I kept working on this thing for about two months. Maybe its
worth the while. But I forgot one thing. This program runs well
only in a screen resolution of 1280 X 1024 or better. I forgot that
while coding this. If the resolution is less, than some of the buttons
will not be displayed properly.
Code: Select all
'============================================
' A DRAWING TOOL
'============================================
'This is a program which enables the user
'to draw simple pictures.
'it is known that only bitmaps are supported
'press any alpahbet key and the alphabet will
'be printed at the mouse position
'press F11 to clear the graphicbox for a new picture
'press F8 to save the picture
'press F9 to open a picture
'press and hold the up arrow to increase the brush size
'press and hold the down arrow to decrease the brush size
bmpTemplate$ = "*.bmp"
graphTemplate$ = "*.gcf"
colorRed = 0
colorGreen = 0
colorBlue = 0
'set the menus
menu #main, "File", "New", [new], |, "Save Graphic Commands", [saveGraph], "Save Bitmap File", [save], |, "Open Graphic Commands", [openGraph], "Open Bitmap File", [open], |, "Exit", [quit]
menu #main, "Options", "About", [about], "View Saved Files Log", [viewLog]
menu #main, "Tools", "Default Brush", [default], "Medium Brush", [medium], "Large Brush", [largebrush], "Air Brush", [airBrush], "Star Shape", [star], "Eraser", [eraser], "&Pan", [pan], "Crayons", [crayons], "Stamps", [stamps], |, "Draw Line", [drawLineSet], "Draw Box", [drawBoxSet], "Draw Circle", [drawCircleSet],
menu #main, "Effects", "Sieve", [blur], "Circular Frames", [circFrames]
nomainwin 'don't open a mainwin
'set window size
WindowWidth = 700
WindowHeight = 700
graphicbox #main.graph3, 315, 800, 70, 35
graphicbox #main.graph5, 635, 800, 70, 35
graphicbox #main.graph, 10, 30, 800, 600
graphicbox #main.graph4, 0, 0, DisplayWidth, 30
graphicbox #main.graphRedFore, 225, 700, 256, 20
graphicbox #main.graphGreenFore, 225, 730, 256, 20
graphicbox #main.graphBlueFore, 225, 760, 256, 20
graphicbox #main.graphRedBack, 545, 700, 256, 20
graphicbox #main.graphGreenBack, 545, 730, 256, 20
graphicbox #main.graphBlueBack, 545, 760, 256, 20
button #main.button1, "Quit", [quit], LL, 50, 50, 80, 40 'set the quit button
button #main.blackFore, "Black", [blackFore], UL, 225, 800, 70, 35
button #main.whiteFore, "White", [whiteFore], UL, 405, 800, 70, 35
button #main.blackBack, "Black", [blackBack], UL, 545, 800, 70, 35
button #main.whiteBack, "White", [whiteBack], UL, 725, 800, 70, 35
open "Liberty Draw" for graphics_fs_nsb as #main
open "graph.gcf" for append as #gcf
print #main, "fill lightgray ; flush"
print #main, "place 250 900 ; font helvetica 12 bold ; color black ; backcolor lightgray ;\Please wait ..."
print #main.graph5, "fill white"
print #main.graph3, "fill black"
print #main, "trapclose [quit]"
print #main.graph4, "fill Buttonface ; flush"
print #main.graph, "when mouseMove [mousemoved]"
print #main, "when rightButtonUp [backColors]"
print #main.graph, "when rightButtonUp [fillBackground]"
print #main.graph, "autoresize"
print #main.graph3, "autoresize"
print #main.graph5, "autoresize"
print #main.graph, "when leftButtonMove [fetch]"
print #main.graph, "when leftButtonDown [fetch]"
print #main.graph, "when leftButtonUp [flush]"
print #main.graph, "when characterInput [keyCheck]"
print #main.graph, "setfocus"
if color$ = "" then color$ = "black"
if size = 0 then size = 3
if backcolora$ = "" then backcolora$ = "white"
if font$ = "" then font$ = "font comic_sans_ms 12"
if fontcolor$ = "" then fontcolor$ = "darkblue"
print #main, "down ; place 200 675 ; color black ; size 1 ; box 500 850 ; flush"
print #main, "down ; place 520 675 ; color black ; size 1 ; box 820 850 ; flush"
print #main, "backcolor lightgray ; place 275 678 ;\Foreground Colours"
print #main, "backcolor lightgray ; place 585 678 ;\Background Colours"
color = -1
place = -1
for X = 1 to 256
color = color + 1
place = place + 1
print #main.graphRedFore, "north ; down ; place ";place;" 20 ; color ";color;" 0 0 ; go 21"
next X
color = -1
place = -1
for X = 1 to 256
color = color + 1
place = place + 1
print #main.graphGreenFore, "north ; down ; place ";place;" 20 ; color 0 ";color;" 0 ; go 21"
next X
color = -1
place = -1
for X = 1 to 256
color = color + 1
place = place + 1
print #main.graphBlueFore, "north ; down ; place ";place;" 20 ; color 0 0 ";color;" ; go 21"
next X
color = -1
place = -1
for X = 1 to 256
color = color + 1
place = place + 1
print #main.graphRedBack, "north ; down ; place ";place;" 20 ; color ";color;" 0 0 ; go 21"
next X
color = -1
place = -1
for X = 1 to 256
color = color + 1
place = place + 1
print #main.graphGreenBack, "north ; down ; place ";place;" 20 ; color 0 ";color;" 0 ; go 21"
next X
color = -1
place = -1
for X = 1 to 256
color = color + 1
place = place + 1
print #main.graphBlueBack, "north ; down ; place ";place;" 20 ; color 0 0 ";color;" ; go 21"
next X
print #main.graphRedFore, "flush"
print #main.graphBlueFore, "flush"
print #main.graphGreenFore, "flush"
print #main.graphGreenBack, "flush"
print #main.graphBlueBack, "flush"
print #main.graphRedBack, "flush"
print #main.graphRedFore, "when leftButtonMove [redSet]"
print #main.graphGreenFore, "when leftButtonMove [greenSet]"
print #main.graphBlueFore, "when leftButtonMove [blueSet]"
print #main.graphRedBack, "when leftButtonMove [redSetb]"
print #main.graphGreenBack, "when leftButtonMove [greenSetb]"
print #main.graphBlueBack, "when leftButtonMove [blueSetb]"
[mainCheck]
print #main.graph, "when leftButtonMove [fetch]"
print #main.graph, "when leftButtonDown [fetch]"
print #main.graph, "when leftButtonUp [flush]"
[timeIt]
timer 50, [updateDisplay]
[default]
tool$ = "Default"
size = 3
print #main, "place 890 50 ; size 1 ; color black ; box 1110 385"
print #main, "place 935 105 ; font helvetica 12 bold ; color black ; backcolor lightgray ;\Brush Properties"
print #main, "place 900 310 ; color black ; backcolor lightgray ; font helvtica 12 bold ;\Size :"
print #main, "place 950 150 ; down ; color black ; size 1 ; backcolor white ; boxfilled 1050 250"
print #main, "down ; place ";1000;" ";200;" ; size ";size;" ; color black ; backcolor black ; circlefilled ";size;""
print #main, "place 1050 290 ; color black ; size 2 ; box 1065 315 ; place 1055 298 ; north ; turn 135 ; go 5 ; turn 90 ; go 5"
print #main, "place 950 290 ; color black ; size 2 ; box 965 315 ; place 957 298 ; north ; turn -135 ; go 5 ; turn -90 ; go 5"
print #main, "place 980 290 ; color black ; backcolor white ; size 2 ; boxfilled 1035 315"
print #main, "place 1000 307 ; color black ; size 2 ; font helvetica 12 bold ;\";size;" "
print #main, "place 850 400 ; down ; color lightgray ; backcolor lightgray ; boxfilled 950 580"
print #main, "when leftButtonUp [sizeBrushCheck]"
print #main, "when leftButtonDown [sizeBrushCheck]"
print #main, "when leftButtonMove [sizeBrushCheck]"
print #main.graph, "when leftButtonMove [fetch]"
print #main.graph, "when leftButtonDown [fetch]"
print #main.graph, "when leftButtonUp [flush]"
print #main, "flush"
gosub [graphicsExceedLimit]
print #main, "place 250 900 ; font helvetica 12 bold ; color black ; backcolor lightgray ;\Ready! "
[main]
scan
input r$
goto [main]
[sizeBrushCheck]
if MouseX > 1050 and MouseX < 1065 and MouseY > 290 and MouseY < 315 then goto [sizeIncrease]
if MouseX > 950 and MouseX < 965 and MouseY > 290 and MouseY < 315 then goto [sizeDecrease]
wait
[fetch]
count = count + 1
print #main.graph, "place ";MouseX;" ";MouseY;" ; color ";color$;" ; down ; size ";size;" ; go 1"
print #gcf, "place ";MouseX;" ";MouseY;" ; color ";color$;" ; down ; size ";size;" ; go 1"
print #main, "place 50 650 ; color darkblue ; backcolor lightgray"
print #main, "down ;\X = ";MouseX;", Y = ";MouseY;" "
print #main, "place 250 900 ; font helvetica 12 bold ; color black ; backcolor lightgray ;\Drawing ... "
wait
[flush]
print #main.graph, "flush"
print #main.graph, "redraw"
print #main.graph4, "flush"
print #main.graph3, "flush"
print #main.graph, "getbmp flush 0 0 800 600"
print #main.graph, "cls"
print #main.graph, "drawbmp flush 0 0"
print #main.graph, "flush"
unloadbmp "flush"
print #main, "place 250 900 ; font helvetica 12 bold ; color black ; backcolor lightgray ;\Waiting! "
print #main, "flush"
if count > 1000 then gosub [graphicsExceedLimit]
wait
[star]
print #main.graph, "flush"
print #main.graph, "getbmp drawing 0 0 800 600"
print #main.graph, "cls"
print #main.graph, "drawbmp drawing 0 0"
print #main.graph, "flush"
unloadbmp "drawing"
tool$ = " star "
print #main.graph, "when leftButtonMove [stardraw]"
print #main.graph, "when leftButtonDown [stardraw]"
print #main.graph, "when leftButtonUp [flush]"
print #main.graph, "flush"
[stardraw]
print #main, "place 250 900 ; font helvetica 12 bold ; color black ; backcolor lightgray ;\Drawing ... "
count = count + 1
print #main, "place 50 650 ; color darkblue ; backcolor lightgray"
print #main, "down ;\X = ";MouseX;", Y = ";MouseY;" "
print #main.graph, "color ";color$;" ; size 3 ; down ; place ";MouseX;" ";MouseY;"; go 3 ; turn 10 ; go 3 ; turn 10 ; go 3 ; turn 10 ; go 3 ; turn 10 ; go 3 ; turn 10 ; go 3"
print #gcf, "color ";color$;" ; size 3 ; down ; place ";MouseX;" ";MouseY;"; go 3 ; turn 10 ; go 3 ; turn 10 ; go 3 ; turn 10 ; go 3 ; turn 10 ; go 3 ; turn 10 ; go 3"
print #main.graph, "when leftButtonUp [flush]"
wait
[medium]
tool$ = "Default"
size = 6.5
print #main.graph, "when leftButtonMove [fetch]"
print #main.graph, "when leftButtonDown [fetch]"
print #main.graph, "when leftButtonUp [flush]"
print #main, "place 950 150 ; down ; color black ; size 1 ; backcolor white ; boxfilled 1050 250"
print #main, "place ";1000;" ";200;" ; size ";size;" ; color black ; backcolor black ; circlefilled ";size/10;""
print #main, "color black ; backcolor white ; place 1000 307 ; color black ; size 2 ; font helvetica 12 bold ;\";size;" "
wait
[largebrush]
tool$ = "Default"
print #main.graph, "when leftButtonMove [fetch]"
print #main.graph, "when leftButtonDown [fetch]"
print #main.graph, "when leftButtonUp [flush]"
print #main, "place 950 150 ; down ; color black ; size 1 ; backcolor white ; boxfilled 1050 250"
print #main, "place ";1000;" ";200;" ; size ";size;" ; color black ; backcolor black ; circlefilled ";size/10;""
print #main, "color black ; backcolor white ; place 1000 307 ; color black ; size 2 ; font helvetica 12 bold ;\";size;" "
size = 15
wait
[quit]
confirm "Are you sure you want to quit?" ;answer$
if answer$ = "yes" then goto [directQuit] else wait
[directQuit]
close #gcf
kill "graph.gcf"
close #main
end
[save]
open "SAVED FILES RECORD.log" for append as #sfr
filedialog "Save the file in the desired directory", bmpTemplate$, path$
print #main, "place 250 900 ; font helvetica 12 bold ; color black ; backcolor lightgray ;\Please wait ... "
print #main.graph, "getbmp drawing 0 0 100 200"
bmpsave "drawing", "";path$;".bmp"
print #sfr, "'";path$;".bmp' was saved on ";date$();" time ";time$();""
print #sfr, ""
close #sfr
bmpTemplate$ = path$ + bmpTemplate$
print #main, "place 250 900 ; font helvetica 12 bold ; color black ; backcolor lightgray ;\Save Complete! "
goto [default]
[open]
filedialog "Select a bitmap file", bmpTemplate$, bmp$
if bmp$ = "" then wait
loadbmp "bmp", bmp$
print #main.graph, "drawbmp bmp 0 0"
print #main.graph, "flush ; redraw"
goto [default]
[new]
let c$ = "Do you want to save" + chr$(13)
let c$ = c$ + "changes before clearing the image?" + chr$(13)
confirm c$ ;answer$
if answer$ = "yes" then goto [save] else goto [clear]
[clear]
timer 0
nomainwin
WindowWidth = DisplayWidth/2
WindowHeight = DisplayHeight/2 - 100
UpperLeftX = (DisplayWidth - WindowWidth)/2
UpperLeftY = (DisplayHeight - WindowHeight)/2
graphicbox #nip.graphRed, 150, 150, 256, 20
graphicbox #nip.graphGreen, 150, 200, 256, 20
graphicbox #nip.graphBlue, 150, 250, 256, 20
graphicbox #nip.preview, 446, 150, 100, 100
button #nip.button1, "Proceed", [proceed], UL, 200, 300, 100, 30
open "New Image Properties" for graphics_nf_nsb as #nip
color = -1
place = -1
for X = 1 to 256
color = color + 1
place = place + 1
print #nip.graphRed, "north ; down ; place ";place;" 20 ; color ";color;" 0 0 ; go 21"
next X
color = -1
place = -1
for X = 1 to 256
color = color + 1
place = place + 1
print #nip.graphGreen, "north ; down ; place ";place;" 20 ; color 0 ";color;" 0 ; go 21"
next X
color = -1
place = -1
for X = 1 to 256
color = color + 1
place = place + 1
print #nip.graphBlue, "north ; down ; place ";place;" 20 ; color 0 0 ";color;" ; go 21"
next X
print #nip.graphRed, "flush"
print #nip.graphGreen, "flush"
print #nip.graphBlue, "flush"
print #nip.graphRed, "when leftButtonMove [redNipCheck]"
print #nip.graphGreen, "when leftButtonMove [greenNipCheck]"
print #nip.graphBlue, "when leftButtonMove [blueNipCheck]"
print #nip, "place 150 120 ; font helvetica 12 bold ; color black ; backcolor white ;\Preview :"
print #nip, "trapclose [quitNip]"
timer 50, [drawPreview]
wait
[redNipCheck]
redColor = MouseX
if redColor > 256 then redColor = 256
if redColor < 1 then redColor = 1
wait
[blueNipCheck]
blueColor = MouseX
if blueColor > 256 then blueColor = 256
if blueColor < 1 then blueColor = 1
wait
[greenNipCheck]
greenColor = MouseX
if greenColor > 256 then greenColor = 256
if greenColor < 1 then greenColor = 1
wait
[drawPreview]
scan
drawn = drawn + 1
preview$ = str$(redColor) + " " + str$(greenColor) + " " + str$(blueColor)
print #nip.preview, "fill ";preview$;""
if drawn mod 500 = 0 then print #nip.preview, "flush"
wait
[quitNip]
close #nip
color$ = "black"
backcolora$ = "white"
print #main.graph, "cls"
goto [timeIt]
[proceed]
timer 0
close #nip
print #main.graph, "cls ; fill ";preview$;" ; flush"
color$ = "black"
backcolora$ = preview$
size = 3
tool$ = "Default"
close #gcf
kill "graph.gcf"
open "graph.gcf" for append as #gcf
print #gcf, "fill ";preview$;" ; flush"
goto [timeIt]
[about]
nomainwin
UpperleftX = 150
UpperLeftY = 150
WindowWidth = 300
WindowHeight = 200
button #about.button1, "OK", [aboutok], UL, 100, 130, 70, 25
open "About Draw" for graphics_nf_nsb as #about
print #about, "fill Buttonface"
c$ = "This is a simple program" + chr$(13)
c$ = c$ + "created by Karthik using" + chr$(13)
c$ = c$ + "Just BASIC v1.01"
print #about, "";font$;""
print #about, "color ";fontcolor$;" ; place 60 50 ; backcolor Buttonface ;\";c$
print #about, "flush"
print #about, "trapclose [aboutok]"
wait
[aboutok]
close #about
wait
[pan]
print #main.graph, "flush"
print #main.graph, "getbmp drawing 0 0 800 600"
print #main.graph, "cls"
print #main.graph, "drawbmp drawing 0 0"
print #main.graph, "flush"
unloadbmp "drawing"
filedialog "Select a bitmap file", "*.bmp", pan$
if pan$ = "" then wait
loadbmp "pan", "";pan$;""
print #main.graph, "when leftButtonDown [pandraw]"
print #main.graph, "when leftButtonMove [pandraw]"
print #main.graph, "when leftButtonUp [flush]"
wait
[pandraw]
count = count + 1
print #main, "place 250 900 ; font helvetica 12 bold ; color black ; backcolor lightgray ;\Drawing ... "
print #main.graph, "drawbmp pan ";MouseX;" ";MouseY;""
print #main, "place 50 650 ; color darkblue ; backcolor lightgray"
print #main, "down ;\X = ";MouseX;", Y = ";MouseY;""
wait
[mousemoved]
print #main, "place 50 650 ; color darkblue ; backcolor lightgray"
print #main, "down ;\X = ";MouseX;", Y = ";MouseY;" "
wait
[readme]
nomainwin
UpperLeftX = 150
UpperLeftY = 100
WindowWidth = 700
WindowHeight = 850
open "Readme" for graphics as #reada
open "Readme.rtf" for input as #rtf
print #reada, "place 10 10"
print #reada, "trapclose [quitreadme]"
[write]
line input #rtf, txt$
print #reada, "";font$;" ; color ";fontcolor$;" ;\";txt$;""
if eof(#rtf) = -1 then goto [written] else goto [write]
[written]
print #reada, "flush"
close #rtf
wait
[quitreadme]
close #reada
wait
[drawLineSet]
print #main.graph, "flush"
print #main.graph, "getbmp drawing 0 0 800 600"
print #main.graph, "cls"
print #main.graph, "drawbmp drawing 0 0"
print #main.graph, "flush"
unloadbmp "drawing"
tool$ = "Line "
print #main, "place 850 400 ; down ; color lightgray ; backcolor lightgray ; boxfilled 955 585"
print #main.graph, "when leftButtonDown [startLine]"
print #main.graph, "when leftButtonMove [drawLine]"
print #main.graph, "when leftButtonUp [finishLine]"
wait
[startLine]
startx = MouseX
starty = MouseY
if color$ = "" then color$ = "";defaultColor$;""
if backcolora$ = "" then backcolora$ = "";defaultBackColora$
if size = 0 then size = defaultSize
print #main, "place 50 650 ; color darkblue ; backcolor lightgray"
print #main, "down ;\X = ";MouseX;", Y = ";MouseY;""
wait
[drawLine]
scan
print #main, "place 250 900 ; font helvetica 12 bold ; color black ; backcolor lightgray ;\Drawing ... "
print #main, "flush"
linecount = linecount + 1
print #main.graph, "down ; color 220 220 220 ; size 0.0000000000000000025 ; line ";startx;" ";starty;" ";MouseX;" ";MouseY;""
print #main, "place 50 650 ; color darkblue ; backcolor lightgray"
print #main, "down ;\X = ";MouseX;", Y = ";MouseY;""
if linecount mod 50 = 0 then print #main.graph, "discard ; redraw"
wait
[finishLine]
count = count + 1
endx = MouseX
endy = MouseY
if color$ = "" then color$ = "black"
print #main.graph, "discard ; redraw"
print #main.graph, "down ; color ";color$;" ; size ";size;" ; line ";startx;" ";starty;" ";endx;" ";endy;""
print #gcf, "down ; color ";color$;" ; size ";size;" ; line ";startx;" ";starty;" ";endx;" ";endy;""
print #main, "place 50 650 ; color darkblue ; backcolor lightgray"
print #main, "down ;\X = ";MouseX;", Y = ";MouseY;""
print #main.graph, "flush"
wait
[drawBoxSet]
print #main.graph, "flush"
print #main.graph, "getbmp drawing 0 0 800 600"
print #main.graph, "cls"
print #main.graph, "drawbmp drawing 0 0"
print #main.graph, "flush"
unloadbmp "drawing"
tool$ = "Box "
print #main, "place 850 400 ; down ; color black ; size 2 ; goto 950 400 ; goto 950 580 ; goto 850 580 ; goto 850 400"
print #main, "place 865 415 ; down ; color black ; size 2 ; box 935 450"
print #main, "place 865 465 ; down ; color black ; size 2 ; backcolor darkgray ; boxfilled 935 500"
print #main, "place 865 515 ; down ; color darkgray ; backcolor darkgray ; boxfilled 935 550"
print #main, "flush"
print #main, "when leftButtonUp [checkMouseBox]"
print #main.graph, "when leftButtonDown [outlineBoxOnlyStart]"
print #main.graph, "when leftButtonMove [outlineBoxOnlyDraw]"
print #main.graph, "when leftButtonUp [outlineBoxOnlyFinish]"
goto [outlineBoxOnly]
wait
[checkMouseBox]
if MouseX > 865 and MouseX < 935 and MouseY > 415 and MouseY < 450 then goto [outlineBoxOnly]
if MouseX > 865 and MouseX < 935 and MouseY > 465 and MouseY < 500 then goto [outlineAndFillBox]
if MouseX > 865 and MouseX < 935 and MouseY > 515 and MouseY < 550 then goto [fillBoxAndOutline]
wait
[outlineBoxOnly]
print #main, "place 865 415 ; size 2 ; color darkblue ; box 935 450"
print #main, "place 865 515 ; down ; color darkgray ; backcolor darkgray ; boxfilled 935 550"
print #main, "place 865 465 ; down ; color black ; size 2 ; backcolor darkgray ; boxfilled 935 500"
print #main.graph, "when leftButtonDown [outlineOnlyStartBox]"
print #main.graph, "when leftButtonMove [outlineOnlyDrawBox]"
print #main.graph, "when leftButtonUp [outlineOnlyFinishBox]"
print #main, "flush"
wait
[outlineOnlyStartBox]
boxstartx = MouseX
boxstarty = MouseY
if color$ = "" then color$ = "";defaultColor$
if size = 0 then size = defaultSize
print #main, "down ; place ";boxsatrtx;" ";boxstarty;""
print #main, "place 50 650 ; color darkblue ; backcolor lightgray"
print #main, "down ;\X = ";MouseX;", Y = ";MouseY;" "
wait
[outlineOnlyDrawBox]
scan
print #main, "place 250 900 ; font helvetica 12 bold ; color black ; backcolor lightgray ;\Drawing ... "
let countboxout = countboxout + 1
print #main.graph, "size 0.5 ; place ";boxstartx;" ";boxstarty;" ; color 220 220 220 ; box ";MouseX;" ";MouseY;""
print #main, "place 50 650 ; color darkblue ; backcolor lightgray"
print #main, "down ;\X = ";MouseX;", Y = ";MouseY;" "
if countboxout mod 30 = 0 then print #main.graph, "discard ; redraw"
wait
[outlineOnlyFinishBox]
count = count + 1
endboxx = MouseX
endboxy = MouseY
print #main.graph, "discard ; redraw"
print #main.graph, "place ";boxstartx;" ";boxstarty;" ; size ";size;" ; color ";color$;" ; box ";endboxx;" ";endboxy;""
print #gcf, "place ";boxstartx;" ";boxstarty;" ; size ";size;" ; color ";color$;" ; box ";endboxx;" ";endboxy;""
print #main, "place 50 650 ; color darkblue ; backcolor lightgray"
print #main, "down ;\X = ";MouseX;", Y = ";MouseY;" "
print #main, "flush"
print #main.graph, "flush"
wait
[outlineAndFillBox]
print #main, "place 865 415 ; down ; color black ; size 2 ; box 935 450"
print #main, "place 865 465 ; down ; color darkblue ; size 2 ; box 935 500"
print #main, "place 865 515 ; down ; color darkgray ; backcolor darkgray ; boxfilled 935 550"
print #main.graph, "when leftButtonDown [outlineAndFillBoxStart]"
print #main.graph, "when leftButtonMove [outlineAndFillBoxDraw]"
print #main.graph, "when leftButtonUp [outlineAndFillBoxFinish]"
print #main, "flush"
wait
[outlineAndFillBoxStart]
boxstartx = MouseX
boxstarty = MouseY
if backcolora$ = "" then backcolora$ = "white"
if color$ = "" then color$ = "black"
if size = 0 then size = 3
print #main.graph, "size 0. 00000005 ; place ";boxstartx;" ";boxstarty;""
print #main, "place 50 650 ; color darkblue ; backcolor lightgray"
print #main, "down ;\X = ";MouseX;", Y = ";MouseY;" "
wait
[outlineAndFillBoxDraw]
scan
print #main, "place 250 900 ; font helvetica 12 bold ; color black ; backcolor lightgray ;\Drawing ... "
countboxfill = countboxfill + 1
print #main.graph, "size 0.00000005 ; place ";boxstartx;" ";boxstarty;" ; down ; color 220 220 220 ; box ";MouseX;" ";MouseY;""
print #main, "place 50 650 ; color darkblue ; backcolor lightgray"
print #main, "down ;\X = ";MouseX;", Y = ";MouseY;" "
if countboxfill mod 20 = 0 then print #main.graph, "discard ; redraw"
wait
[outlineAndFillBoxFinish]
count = count + 1
boxendx = MouseX
boxendy = MouseY
print #main.graph, "discard ; redraw"
print #main.graph, "place ";boxstartx;" ";boxstarty;" ; down ; backcolor ";backcolora$;" ; color ";color$;" ; size ";size;" ; boxfilled ";boxendx;" ";boxendy;""
print #gcf, "place ";boxstartx;" ";boxstarty;" ; down ; backcolor ";backcolora$;" ; color ";color$;" ; size ";size;" ; boxfilled ";boxendx;" ";boxendy;""
print #main.graph, "flush"
print #main, "flush"
wait
[fillBoxAndOutline]
print #main, "place 865 515 ; down ; color darkblue ; backcolor darkblue ; boxfilled 935 550"
print #main, "place 865 415 ; down ; color black ; size 2 ; box 935 450"
print #main, "place 865 465 ; down ; color black ; size 2 ; box 935 500"
print #main.graph, "when leftButtonDown [fillBoxAndOutlineStart]"
print #main.graph, "when leftButtonMove [fillBoxAndOutlineDraw]"
print #main.graph, "when leftButtonUp [fillBoxAndOutlineFinish]"
print #main, "flush"
wait
[fillBoxAndOutlineStart]
boxxa = MouseX
boxya = MouseY
if color$ = "" then color$ = "";defaultColor$
if size = 0 then size = defaultSize
if backcolora$ = "" then backcolora$ = "";defaultBackColor$
print #main, "place 50 650 ; color darkblue ; backcolor lightgray"
print #main, "down ;\X = ";MouseX;", Y = ";MouseY;" "
wait
[fillBoxAndOutlineDraw]
scan
print #main, "place 250 900 ; font helvetica 12 bold ; color black ; backcolor lightgray ;\Drawing ... "
boxfilled = boxfilled + 1
print #main.graph, "down ; place ";boxxa;" ";boxya;" ; color 220 220 220 ; size 0.0000045 ; box ";MouseX;" ";MouseY;""
print #main, "place 50 650 ; color darkblue ; backcolor lightgray"
print #main, "down ;\X = ";MouseX;", Y = ";MouseY;" "
if boxfilled mod 20 = 0 then print #main.graph, "discard ; redraw"
wait
[fillBoxAndOutlineFinish]
count = count + 1
boxendx = MouseX
boxendy = MouseY
print #main.graph, "discard ; redraw"
print #main.graph, "down ; place ";boxxa;" ";boxya;" ; color ";color$;" ; backcolor ";color$;" ; boxfilled ";boxendx;" ";boxendy;""
print #gcf, "down ; place ";boxxa;" ";boxya;" ; color ";color$;" ; backcolor ";color$;" ; boxfilled ";boxendx;" ";boxendy;""
print #main, "place 50 650 ; color darkblue ; backcolor lightgray"
print #main, "down ;\X = ";MouseX;", Y = ";MouseY;" "
print #main, "flush"
print #main.graph, "flush"
wait
[airBrush]
print #main.graph, "flush"
print #main.graph, "getbmp drawing 0 0 800 600"
print #main.graph, "cls"
print #main.graph, "drawbmp drawing 0 0"
print #main.graph, "flush"
unloadbmp "drawing"
if size = 0 then size = defaultSize
if color$ = "" then color$ = "";defaultColor$
print #main.graph, "when leftButtonDown [drawAirbrush]"
print #main.graph, "when leftButtonMove [drawAirbrush]"
print #main.graph, "when leftButtonUp [flush]"
wait
[drawAirbrush]
scan
print #main, "place 250 900 ; font helvetica 12 bold ; color black ; backcolor lightgray ;\Drawing ... "
count = count + 1
for X = 1 to 150
xa = int(rnd(1)*(size + 20)) + MouseX
ya = int(rnd(1)*(size + 20)) + MouseY
print #main.graph, "down ; place ";xa;" ";ya;" ; color ";color$;" ; size 0.5 ; go 1"
print #gcf, "down ; place ";xa;" ";ya;" ; color ";color$;" ; size 0.5 ; go 1"
next X
print #main, "place 50 650 ; color darkblue ; backcolor lightgray"
print #main, "down ;\X = ";MouseX;", Y = ";MouseY;" "
wait
[drawCircleSet]
print #main.graph, "flush"
print #main.graph, "getbmp drawing 0 0 800 600"
print #main.graph, "cls"
print #main.graph, "drawbmp drawing 0 0"
print #main.graph, "flush"
unloadbmp "drawing"
tool$ = "Ellipse "
print #main, "place 850 400 ; down ; color black ; size 2 ; goto 950 400 ; goto 950 580 ; goto 850 580 ; goto 850 400"
print #main, "place 865 415 ; down ; color black ; size 2 ; box 935 450"
print #main, "place 865 465 ; down ; color black ; size 2 ; backcolor darkgray ; boxfilled 935 500"
print #main, "place 865 515 ; down ; color darkgray ; backcolor darkgray ; boxfilled 935 550"
print #main, "flush"
print #main.graph, "when leftButtonDown [outlineCircleOnlyStart]"
print #main.graph, "when leftButtonMove [outlineCircleOnlyDraw]"
print #main.graph, "when leftButtonUp [outlineCircleOnlyFinish]"
print #main, "when leftButtonUp [checkMouseCircle]"
goto [outlineCircleOnly]
wait
[checkMouseCircle]
if MouseX > 865 and MouseX < 935 and MouseY > 415 and MouseY < 450 then goto [outlineCircleOnly]
if MouseX > 865 and MouseX < 935 and MouseY > 465 and MouseY < 500 then goto [outlineAndFillCircle]
if MouseX > 865 and MouseX < 935 and MouseY > 515 and MouseY < 550 then goto [fillCircleAndOutline]
wait
[outlineCircleOnly]
print #main, "place 865 415 ; size 2 ; color darkblue ; box 935 450"
print #main, "place 865 515 ; down ; color darkgray ; backcolor darkgray ; boxfilled 935 550"
print #main, "place 865 465 ; down ; color black ; size 2 ; backcolor darkgray ; boxfilled 935 500"
print #main.graph, "when leftButtonDown [outlineCircleOnlyStart]"
print #main.graph, "when leftButtonMove [outlineCircleOnlyDraw]"
print #main.graph, "when leftButtonUp [outlineCircleOnlyFinish]"
print #main, "flush"
wait
[outlineCircleOnlyStart]
startcirclex = MouseX
startcircley = MouseY
if color$ = "" then color$ = "black"
if size = 0 then size = 3
print #main, "place 50 650 ; color darkblue ; backcolor lightgray"
print #main, "down ;\X = ";MouseX;", Y = ";MouseY;""
wait
[outlineCircleOnlyDraw]
scan
print #main, "place 250 900 ; font helvetica 12 bold ; color black ; backcolor lightgray ;\Drawing ... "
circleout = circleout + 1
print #main.graph, "place ";startcirclex;" ";startcircley;" ; down ; size 0.5 ; color 220 220 220 ; box ";MouseX;" ";MouseY;""
print #main, "place 50 650 ; color darkblue ; backcolor lightgray"
print #main, "down ;\X = ";MouseX;", Y = ";MouseY;""
if circleout mod 25 = 0 then print #main.graph, "discard ; redraw"
wait
[outlineCircleOnlyFinish]
endcirclex = MouseX
endcircley = MouseY
print #main.graph, "discard ; redraw"
print #main.graph, "place ";startcirclex + ((MouseX - startcirclex)/2) ;" ";startcircley + ((MouseY - startcircley)/2) ;" ; size ";size;" ; color ";color$;" ; ellipse ";MouseX - startcirclex;" ";MouseY - startcircley;""
print #gcf, "place ";startcirclex + ((MouseX - startcirclex)/2) ;" ";startcircley + ((MouseY - startcircley)/2) ;" ; size ";size;" ; color ";color$;" ; ellipse ";MouseX - startcirclex;" ";MouseY - startcircley;""
print #main, "place 50 650 ; color darkblue ; backcolor lightgray"
print #main, "down ;\X = ";MouseX;", Y = ";MouseY;""
print #main, "flush"
print #main.graph, "flush"
wait
[outlineAndFillCircle]
print #main, "place 865 415 ; down ; color black ; size 2 ; box 935 450"
print #main, "place 865 465 ; down ; color darkblue ; size 2 ; box 935 500"
print #main, "place 865 515 ; down ; color darkgray ; backcolor darkgray ; boxfilled 935 550"
print #main.graph, "when leftButtonDown [outlineAndFillCircleStart]"
print #main.graph, "when leftButtonMove [outlineAndFillCircleDraw]"
print #main.graph, "when leftButtonUp [outlineAndFillCircleFinish]"
print #main, "flush"
wait
[outlineAndFillCircleStart]
startx = MouseX
starty = MouseY
if backcolora$ = "" then backcolora$ = "black"
if color$ = "" then color$ = "black"
if size = 0 then size = 3
print #main.graph, "size 0. 00000005 ; place ";startx;" ";starty;""
print #main, "place 50 650 ; color darkblue ; backcolor lightgray"
print #main, "down ;\X = ";MouseX;", Y = ";MouseY;""
wait
[outlineAndFillCircleDraw]
scan
print #main, "place 250 900 ; font helvetica 12 bold ; color black ; backcolor lightgray ;\Drawing ... "
countcircle = countcircle + 1
print #main.graph, "place ";startx;" ";starty;" ; down ; size 0.5 ; color 220 220 220 ; box ";MouseX;" ";MouseY;""
print #main, "place 50 650 ; color darkblue ; backcolor lightgray"
print #main, "down ;\X = ";MouseX;", Y = ";MouseY;""
if countcircle mod 20 = 0 then print #main.graph, "discard ; redraw"
wait
[outlineAndFillCircleFinish]
print #main.graph, "discard ; redraw"
print #main.graph, "place ";startx + ((MouseX - startx)/2);" ";starty + ((MouseY - starty)/2);" ; down ; size ";size;" ; color ";color$;" ; backcolor ";backcolora$;" ; ellipsefilled ";MouseX - startx;" ";MouseY - starty;""
print #gcf, "place ";startx + ((MouseX - startx)/2);" ";starty + ((MouseY - starty)/2);" ; down ; size ";size;" ; color ";color$;" ; backcolor ";backcolora$;" ; ellipsefilled ";MouseX - startx;" ";MouseY - starty;""
print #main, "place 50 650 ; color darkblue ; backcolor lightgray"
print #main, "down ;\X = ";MouseX;", Y = ";MouseY;""
goto [flush]
wait
[fillCircleAndOutline]
print #main, "place 865 515 ; down ; color darkblue ; backcolor darkblue ; boxfilled 935 550"
print #main, "place 865 415 ; down ; color black ; size 2 ; box 935 450"
print #main, "place 865 465 ; down ; color black ; size 2 ; box 935 500"
print #main.graph, "when leftButtonDown [fillCircleAndOutlineStart]"
print #main.graph, "when leftButtonMove [fillCircleAndOutlineDraw]"
print #main.graph, "when leftButtonUp [fillCircleAndOutlineFinish]"
print #main, "flush"
wait
[fillCircleAndOutlineStart]
startx = MouseX
starty = MouseY
if color$ = "" then color$ = "black"
if size = 0 then size = 3
wait
[fillCircleAndOutlineDraw]
scan
print #main, "place 250 900 ; font helvetica 12 bold ; color black ; backcolor lightgray ;\Drawing ... "
circlecount = circlecount + 1
print #main.graph, "place ";startx;" ";starty;" ; color 220 220 220 ; size 0.5 ; down ; box ";MouseX;" ";MouseY;""
print #main, "place 50 650 ; color darkblue ; backcolor lightgray"
print #main, "down ;\X = ";MouseX;", Y = ";MouseY;""
if circlecount mod 20 = 0 then print #main.graph, "discard ; redraw"
wait
[fillCircleAndOutlineFinish]
print #main.graph, "discard ; redraw"
print #main.graph, "size ";size;" ; place ";startx + ((MouseX - startx)/2);" ";starty + ((MouseY - starty)/2);" ; color ";color$;" ; backcolor ";color$;" ; down ; ellipsefilled ";MouseX - startx;" ";MouseY - starty;""
print #gcf, "size ";size;" ; place ";startx + ((MouseX - startx)/2);" ";starty + ((MouseY - starty)/2);" ; color ";color$;" ; backcolor ";color$;" ; down ; ellipsefilled ";MouseX - startx;" ";MouseY - starty;""
print #main, "place 50 650 ; color darkblue ; backcolor lightgray"
print #main, "down ;\X = ";MouseX;", Y = ";MouseY;""
goto [flush]
wait
[keyCheck]
keyPress = asc(right$(Inkey$, 1))
if keyPress = _VK_F11 then goto [new]
if keyPress = _VK_F8 then goto [save]
if keyPress = _VK_F9 then goto [open]
if keyPress = _VK_UP then goto [sizeIncrease]
if keyPress = _VK_DOWN then goto [sizeDecrease]
print #main.graph, "place ";MouseX;" ";MouseY;" ; color ";color$;" ;\";Inkey$;""
wait
[fillBackground]
print #main.graph, "fill ";backcolora$;""
print #gcf, "fill ";backcolora$;""
goto [flush]
[updateDisplay]
scan
print #main.graph4, "place 900 20 ; font helvetica 15 ; color black ; backcolor Buttonface ;\";date$();" ";time$();""
print #main, "place 935 130 ; font helvetica 12 bold ; color black ; backcolor lightgray ;\Tool : ";tool$;""
color$ = str$(colorRed) + " " + str$(colorGreen) + " " + str$(colorBlue)
backcolora$ = str$(colorRedb) + " " + str$(colorGreenb) + " " + str$(colorBlueb)
print #main.graph3, "fill ";color$;""
print #main.graph5, "fill ";backcolora$;""
goto [main]
[eraser]
print #main.graph, "flush"
print #main.graph,"getbmp drawing 0 0 800 600"
print #main.graph, "cls"
print #main.graph, "drawbmp drawing 0 0"
print #main.graph, "flush"
unloadbmp "drawing"
print #main, "place 250 900 ; font helvetica 12 bold ; color black ; backcolor lightgray ;\Erasing ... "
scan
tool$ = "eraser"
colorRed = 255
colorGreen = 255
colorBlue = 255
goto [main]
[graphicsExceedLimit]
scan
count = 0
print #main.graph, "flush"
print #main.graph,"getbmp drawing 0 0 800 600"
print #main.graph, "cls"
print #main.graph, "drawbmp drawing 0 0"
print #main.graph, "flush"
return
[redSet]
colorRed = MouseX
if colorRed > 256 then colorRed = 256
if colorRed < 0 then colorRed = 0
goto [main]
[greenSet]
colorGreen = MouseX
if colorGreen > 256 then colorGreen = 256
if colorGreen < 0 then colorGreen = 0
goto [main]
[blueSet]
colorBlue = MouseX
if colorBlue > 256 then colorBlue = 256
if colorBlue < 0 then colorBlue = 0
goto [main]
[sizeIncrease]
size = size + 1
if size > 80 then size = 80
if size < 1 then size = 1
print #main, "place ";1000;" ";200;" ; size ";size;" ; color black ; backcolor black ; circlefilled ";size/10;""
print #main, "color black ; backcolor white ; place 1000 307 ; color black ; size 2 ; font helvetica 12 bold ;\";size;" "
goto [main]
[sizeDecrease]
size = size - 1
if size < 1 then size = 1
if size > 80 then size = 80
print #main, "place 950 150 ; down ; color black ; size 1 ; backcolor white ; boxfilled 1050 250"
print #main, "place ";1000;" ";200;" ; size ";size;" ; color black ; backcolor black ; circlefilled ";size/10;""
print #main, "color black ; backcolor white ; place 1000 307 ; color black ; size 2 ; font helvetica 12 bold ;\";size;" "
goto [main]
[redSetb]
colorRedb = MouseX
if colorRedb > 256 then colorRedb= 256
if colorRedb< 0 then colorRedb = 0
goto [main]
[greenSetb]
colorGreenb= MouseX
if colorGreenb > 256 then colorGreenb = 256
if colorGreenb < 0 then colorGreenb = 0
goto [main]
[blueSetb]
colorBlueb = MouseX
if colorBlueb > 256 then colorBlueb = 256
if colorBlueb < 0 then colorBlueb = 0
goto [main]
[blackFore]
colorRed = 0
colorGreen = 0
colorBlue = 0
goto [main]
[whiteFore]
colorRed = 255
colorGreen = 255
colorBlue = 255
goto [main]
[blackBack]
colorRedb = 0
colorGreenb = 0
colorBlueb = 0
goto [main]
[whiteBack]
colorRedb = 255
colorGreenb = 255
colorBlueb = 255
goto [main]
[viewLog]
timer 0
nomainwin
WindowWidth = 1000
WindowHeight = 600
UpperLeftX = (DisplayWidth - WindowWidth)/2
UpperLeftY = (DisplayWidth - WindowWidth)/2
open "SAVED FILES LOG" for graphics as #sfl
open "SAVED FILES RECORD.log" for input as #reada
print #sfl, "color cyan ; backcolor darkblue ; fill darkblue ; font helvetica 12 bold"
print #sfl, "trapclose [quitSfl]"
print #sfl, "place 50 50 ; font helvetica 12 bold"
[readSfl]
line input #reada, txt$
print #sfl, "|";txt$
if eof(#reada) = -1 then goto [readSflEnd] else goto [readSfl]
[readSflEnd]
close #reada
print #sfl, "flush"
counta = 0
wait
[quitSfl]
close #sfl
goto [timeIt]
[viewScreenShotLog]
timer 0
open "screenshots\screenshots.log" for input as #ssl
nomainwin
WindowWidth = 800
WindowHeight = 600
UpperLeftX = (DisplayWidth - WindowWidth)/2
UpperLeftY = (DisplayHeight - WindowHeight)/2
open "SCREENSHOT LOG" for graphics_nf_nsb as #shl
print #shl, "font helvetica 12 bold ; color cyan ; backcolor darkblue ; fill darkblue"
print #shl, "trapclose [quitShl]"
[readShl]
counts = counts + 1
line input #shl, txt$
print #shl, "|";counts;") ";txt$
if eof(#shl) = -1 then goto [readShlEnd] else goto [readShl]
[readShlEnd]
close #shl
print #shl, "flush"
wait
[quitShl]
close #shl
goto [timeIt]
[openGCF]
open "graph.gcf" for append as #gcf
goto [timeIt]
[saveGraph]
timer 0
filedialog "Save the file", graphTemplate$, gcf$
if gcf$ = "" then wait
close #gcf
open "graph.gcf" for input as #gcf
open "";gcf$;".gcf" for append as #gcfS
print #main, "place 250 900 ; font helvetica 12 bold ; color black ; backcolor lightgray ;\Saving ... "
[readG]
line input #gcf, txt$
print #gcfS, txt$
if eof(#gcf) = -1 then goto [readGend] else goto [readG]
[readGend]
close #gcf
close #gcfS
open "SAVED FILES RECORD.log" for append as #sfr
print #sfr, "'";gcf$;".gcf' was saved on ";date$();" time ";time$();""
print #sfr, ""
close #sfr
print #main, "place 250 900 ; font helvetica 12 bold ; color black ; backcolor lightgray ;\Save Complete! "
graphTemplate$ = gcf$ + graphTemplate$
goto [openGCF]
[openGraph]
close #gcf
timer 0
filedialog "Select a file to be opened", graphTemplate$, gcf$
if gcf$ = "" then wait
open "";gcf$;"" for input as #gcfInput
open "graph.gcf" for append as #gcf
print #main, "place 250 900 ; font helvetica 12 bold ; color black ; backcolor lightgray ;\Opening ... "
print #main.graph, "cls"
[readGcf]
line input #gcfInput, txt$
print #main.graph, txt$
print #gcf, txt$
if eof(#gcfInput) = -1 then goto [gcfEnd] else goto [readGcf]
[gcfEnd]
close #gcf
close #gcfInput
print #main, "place 250 900 ; font helvetica 12 bold ; color black ; backcolor lightgray ;\Complete! "
print #main.graph, "flush"
goto [openGCF]
[crayons]
tool$ = "crayons "
print #main.graph, "when leftButtonMove [drawCrayon]"
print #main.graph, "when leftButtonUp [flush]"
print #main.graph, "when leftButtonDown [drawCrayon]"
wait
[drawCrayon]
scan
for X = 1 to size + 5
print #main.graph, "place ";MouseX;" ";MouseY;" ; down ; color ";color$;" ; size ";0.5;" ; circle ";X;""
print #gcf, "place ";MouseX;" ";MouseY;" ; down ; color ";color$;" ; size ";0.5;" ; circle ";X;""
next X
wait
[blur]
c$ = "Are you sure you want to apply this effect" + chr$(13)
c$ = c$ + "to your picture? Changes once made cannot" + chr$(13)
c$ = c$ + "be undone."
confirm c$ ;answer$
if answer$ = "yes" then goto [doSeive] else wait
[doSeive]
print #main, "place 250 900 ;\Please Wait ... "
for Y = 0 to 600 step 3
for X = 1 to 800 step 3
print #main.graph, "place ";X;" ";Y;" ; down ; color ";color$;" ; size 1 ; go 1"
print #gcf, "place ";X;" ";Y;" ; down ; color ";color$;" ; size 1 ; go 1"
next X
next Y
print #main, "place 250 900 ;\Complete! "
goto [flush]
wait
[circFrames]
timer 0
prompt "Enter the radius of the display area :" ;radius
if radius < 1 then radius = 1
c$ = "Are you sure you want to apply this effect" + chr$(13)
c$ = c$ + "to your picture? Changes once made cannot be reversed."
confirm c$ ;answer$
if answer$ = "yes" then goto [confirmCircFrame] else goto [timeIt]
wait
[confirmCircFrame]
num = radius + 500
for X = 250 to num
print #main.graph, "place 400 300 ; down ; color ";color$;" ; circle ";X;""
print #gcf, "place 400 300 ; down ; color ";color$;" ; circle ";X;""
next X
print #main.graph, "flush"
print #main.graph, "getbmp flush 0 0 800 600"
print #main.graph, "cls"
print #main.graph, "drawbmp flush 0 0"
print #main.graph, "flush"
goto [timeIt]