Saving Canvas to Internal Storage

To be able to see an image in the Gallery, it must be stored in shared storage

Just set default file scope in the project properties to Legacy and use the Canvas.SaveAs method together with path /Download/canvas.jpg

Taifun
PS: yes, the example needs an update

Thanks Taifun, I have updated the app as per your recommendations. On saving the canvas, the gallery still does not refresh on its own, I have to restart the phone for the jpg to appear in the download folder. This is ok for one off instance but is not practical for an app which outputs jpg files. Could I request a review of the gallery refresh method on AI2 ?

Using the FilePicker component should always find it ?

Try this one:
refresh_Anke.aia (11.4 KB)

Thanks Anke, the gallery now refreshes when I use the AI Companion. When I compile and use the app directly on the phone, I get the attached runtime error. Could you please suggest the solution for this.

Rename the fileName to "myImage1.jpg" and try again without testing with Companion beforehand.

Thanks Anke, this works !

Btw, ...

grafik

also used in my refresh_Anke.aia, so as @Taifun said...

Indeed. :wink:

hello sir, i'm creating a geocam app, and im having trouble saving it, when i tried your .aia sample it works. but when i started to change things, im not getting the result i want. this is what i did but afterpicture image wont show on canvas backgroundimage, when i save it, it do save as plain white. also sir, i cant figure out where to set DefaultFileScope=Legacy, its not on the properties panel of screen on Designer page.

You will find the FileScope setting in Project Properties on the main screen:

1 Like

See also here:

1 Like

thank you sir!

thank you sir! i made progress with both of your help..
i'm having an issue with my project sir.


after taking picture, the image capture doesnt show up at canvas. but saving the blank canvas is working and showing up at gallery.

i tried to change filescope to app again and the captured image do show in canvas, but saving in gallery is not working again. and drawtext to canvas is not working as well

DefaultFileScope = Legacy doesn't work on Android 11+ with the Camera component, because the Camera.AfterPicture path is not a Shared folder and therefore the app does not have access to it.

So set DefaultFileScope = Shared and try again.

1 Like

thank you so much sir, it do save in the gallery and shows up in canvas. but my drawtext dont appear on the saved image, and it saves 2 images. is it possible to just save the drawn image ?

my x and y are off the canvas sir.. im fixing it already

is location sensor not working in companion mode? do i need to build an apk to make it work sir?

1 Like

sir, relPath is procedure ? can i also see its block ? thank you so much for assisting

grafik

1 Like


sir this is what i currently have, im not getting the image in canvas after taking picture and saving 2 images, one is blank white and the other is the image i captured.

Post the aia or send it to me via PM.

1 Like

1 Like