Clearing an image and returning to the canvas/background image

1,219 views
Skip to first unread message

Nicole Simmons

unread,
Apr 27, 2015, 10:19:11 AM4/27/15
to mitappinv...@googlegroups.com
I have completed the Paint Pot parts 1 & 2 along with the extended version with the camera. I can get the picture to pop up that I have taken from the camera; however, I would like to create a "Full Reset" button where it brings me back to the start screen that I first see when I use the app. How can I do this? TIA

SteveJG

unread,
Apr 27, 2015, 10:49:20 AM4/27/15
to mitappinv...@googlegroups.com
set  Canvas1.Clear    will clear the photo image.

Possibly you may also need most of the code that might be  in your Screen1.Initialize event handler.  

These are guesses.   You did not post any blocks showing how you modified the app.

Regards,
Steve

Nicole Simmons

unread,
Apr 27, 2015, 11:44:49 AM4/27/15
to mitappinv...@googlegroups.com


NicLSim

unread,
Apr 27, 2015, 11:47:06 AM4/27/15
to mitappinv...@googlegroups.com
So the above is what my current blocks look like. You can see i'm trying to figure out how to get my "Startover" button to not only clear the canvas, but to return back to the original canvas background (*ButterflyCanvas)

*I am using a picture of a butterfly in place of the cat.

SteveJG

unread,
Apr 27, 2015, 1:52:11 PM4/27/15
to mitappinv...@googlegroups.com
set Canvas1.BackgroundImage to    ButterflyCanvas.png     perhaps  well, in your case that would be set ButterflyCanvas.BackgroudImage to ButterflyCanvas.png or jpg    where ButterflyCanvas.jpg  is typed exactly as the file name is in Media    .... you need the file extension, whether it is png or jpg.

NicLSim

unread,
Apr 28, 2015, 11:29:22 PM4/28/15
to mitappinv...@googlegroups.com
Ok, that at least did something! It cleared the image taken with the camera, but the canvas went blank- all white. Any suggestions?


SteveJG

unread,
Apr 29, 2015, 8:19:06 AM4/29/15
to mitappinv...@googlegroups.com
Correct , set Canvas.Clear   clears the existing image.   As indicated above you then have to set Canvas.BackgroundImage  to the image you want to display.  Since you want the original image, you will have that image in your Media.   

Taifun

unread,
Apr 29, 2015, 9:39:13 AM4/29/15
to mitappinv...@googlegroups.com
use simple image names without spaces to avoid issues, for example butterfly.jpg
Taifun
Reply all
Reply to author
Forward
0 new messages