We are about to switch to a new forum software. Until then we have removed the registration on this forum.
I have been working on this little program, where you can make rectangles around some pictures. Now I just need to save it, so when you open the program again the same pictures are marked.
Screenshot of the program: http://puu.sh/imm3Y/fcd4a25cc8.jpg
Have been trying to use the 'Save' button, to make a screenshot but it seems to make a screenshot everytime I click on a new picture.
Answers
you can load and save your program itself I guess...
you probably have a grid telling what images are selected
now store the grid on the hard drive using saveTable() or saveStrings()
for the latter you could loop thru the1st line and place x for selected and o for not selected
strLine[i] += 'x';
then save
;-)
hmm, I new to this so havent used a grid.
Example from the first picture:
void draw() { image(Acerba,2,2); }
void mousePressed() { if ((mouseButton == LEFT) && (mouseX > 2) && (mouseX < 34) && (mouseY > 2) && (mouseY < 34)) { stroke(255,0,0); strokeWeight(2); rect (2,2,32,32); } else if ((mouseButton == RIGHT) && (mouseX > 2) && (mouseX < 34) && (mouseY > 2) && (mouseY < 34)){ stroke(0,0,255); strokeWeight(2); rect (2,2,32,32); }
Sry, if it's messy but maybe I should make it into a grid as you are saying?
ah, I thought you meant like start program - select 3 images - end the sketch - start again and the 3 images still are selected
but you mean just store the mouse click in the first place
yeah grid...
also you want to automize the positions
and not have a
if
for each cell..... like in your example...Oh, is it possible to save the mouse clicks or do I have to start over?
do you have one image or 20x3?
I have 66 images
like this
there are some advanced techniques involved like
a 2D grid (see tutorials on the web site) named grid (whixh holds all false at startup btw.
the
!
means not, inverting the old value (like true becomes false...)also double for-loop, one for the rows the other for the columns
to do
enter the mouseX mouseY if similar to what you got
[EDITED]
Well, that looks advanced. I'll try to look into it.
Thx, m8!
it's actually close to "most simple"
think about it how powerful it is
you can position the rects / images in one go and check mouse in one go.
that's awesome - think: in your approach you typed numbers for the mouse; you'd had to type this line 33 times with different numbers and then again 33 lines with different numbers to draw the 33 images...
man.....
;-)
400/cellSizeX
just says "numbers of cells in a row"
because the width of the grid is 400 and then we divide by the width of one cell to get the numbers of cells in a row