
-----------------------------------
Reality Check
Wed Jun 14, 2006 11:20 pm

MY FINAL ISU: ENJOY!
-----------------------------------
To clarify, I'm in grade 10 and just finished my ISU.  Its a paint program and I really like how its turned out.  I've tested on 4 different computers and it runs smoothly on all.  I'd like to thank these forums for helping me through some rough patches and I'd like to clarify that the spray can tool concept was obtained from one of the topics made by a regular (Andy I think could be wrong though).  I was going to implement a file > save as and file > load type of thing but I ran out of time.  So for future reference, what are some improvements I could make and whats good about it?  Thanks for the feedback.

-----------------------------------
[Gandalf]
Wed Jun 14, 2006 11:33 pm


-----------------------------------
There's no file or source code. ;)

-----------------------------------
Reality Check
Wed Jun 14, 2006 11:45 pm


-----------------------------------
*hits self on head*

I was too busy writing my topic that I forgot to put it in

*hits self again*

here

-----------------------------------
Reality Check
Thu Jun 15, 2006 1:53 pm


-----------------------------------
My teacher says she really likes it  :D .  I may add in a save feature and undo feature...although the undo will only work once so no more than one undo.

-----------------------------------
upthescale
Thu Jun 15, 2006 1:55 pm


-----------------------------------
amazing man, i love the spray painttool

-----------------------------------
jamonathin
Thu Jun 15, 2006 2:20 pm


-----------------------------------
I've never written a paint program myself, but save and undo will be fairly easy to incorporate into your program.

For Save:

You are already drawing and capturing a picture, its all a matter of using Pic.Save - really easy to use.  And you know how to make your own buttons, so it should be fairly easy for you.

For Undo:
You could just store the images in an array, like such.


var pics : flexible array 1 .. 0 of int
And every time you need to make a picture you add 1 and take a pic, like such:

new pics, upper (pics) + 1
pics (upper(pics)) := Pic.New (0, 0, maxx, maxy)

Then when undo-ing, just check like such. .


if upper(pics) - 1 > 0 then
new pics, upper (pics) - 1
end if

Pic.Draw (pics(upper(pics), 0, 0, picCopy)
Somethin like that.

But you have an error in your program, and thats when you draw a maple leaf or star too far (off screen).

Good work on it :).

-----------------------------------
upthescale
Thu Jun 15, 2006 6:40 pm


-----------------------------------
also when u click and hold a button the screen will go flashy, fer the filled adn not filled, to fix that put setscreen("offscreenonly") at the top and right b4 the end loop at the bottom, place the 2 werds

View.Update

other than that amazing job as said b4 lol

-----------------------------------
Reality Check
Thu Jun 15, 2006 9:01 pm


-----------------------------------
My teacher was nice enough to allow me to re-submit with a save and load feature.  Should be extremely easy to implement.

-----------------------------------
[Gandalf]
Sat Jun 17, 2006 9:15 pm


-----------------------------------
For Undo:
You could just store the images in an array, like such.


var pics : flexible array 1 .. 0 of int
And every time you need to make a picture you add 1 and take a pic, like such:

new pics, upper (pics) + 1
pics (upper(pics)) := Pic.New (0, 0, maxx, maxy)

Then when undo-ing, just check like such. .


if upper(pics) - 1 > 0 then
new pics, upper (pics) - 1
end if

Pic.Draw (pics(upper(pics), 0, 0, picCopy)
Somethin like that.
The problem is that that would require massive amounts of memory, something which Turing isn't really efficient at.  An alternative would be to save all the Draw module calls needed to create your image in a text file, and add/subtract from that when something is drawn/you undo.  The only down side to this is that you would need to redraw everything when you undo, but it's still far more efficient than saving a bunch of pictures to memory.

-----------------------------------

Sat Jun 17, 2006 9:32 pm


-----------------------------------
That's crazy. Only a few lines of code for all that.

-----------------------------------
Reality Check
Sat Jun 17, 2006 10:13 pm


-----------------------------------
I don't tink I'll get around to doing the undo, I added an undo but it works once.  Maybe after exams when I have time I'll work on it.

-----------------------------------
MysticVegeta
Sun Jun 18, 2006 2:02 pm


-----------------------------------
Hmm I will try to remember what I did, I think for undo I made a 2D int array of size of the drawpad, then ran a loop and stored the value of each pixel in the array... then if undo was pressed then the values of new 2d array would be replaced by that of the old 2d array and a sketch of that would be drawn

-----------------------------------
[Gandalf]
Sun Jun 18, 2006 3:16 pm


-----------------------------------
Tsk tsk, that would be even less efficient than storing an array of images via Pic.Save, and it would basically be doing the same thing.
