Photo save problems

hello please i need help with my code.
i am taking an image and renaming it and saving it but the size of the image is stretching and i can’t find a solution. i need it to be stored as original size.

thanx in advance

Once you transfer the image to the Canvas, your image assumes the dimensions of the Canvas. You have to handle that. Tim has some recommendations Basic Canvas question that might help you.

If you want the identical image, you must set the saved image using the identical dimensions (H x W) in pixels. At the moment, you are not doing that. You are probably setting Canvas dimensions as Automatic as a guess. Be aware, you need to know the original image dimensions to do this.


is there anyway to rename it and save it without putting it in canvas. because i wanna use the app for multiple phones and each with own resolution

Here is what you can do Search results for 'save picture' - MIT App Inventor Community to take and save a camera picture.

So, do it. The way to do this probably is to use a Canvas. Pixel dimensions are the same on all devices (ignoring screen density)

You have many mistakes on your Block image, the largest is your attempt to save a jpeg to a TinyDB...that is not possible. I believe the only way to save an image as a jpg with AI2 is by using the Canvas. Perhaps there is an cannot do this with native AI2 blocks otherwise.

Here are some resources to help you learn to use the AI2 tools. A very good way to learn App Inventor is to read the free Inventor's Manual here in the AI2 free online eBook ... the links are at the bottom of the Web page. The book 'teaches' users how to program with AI2 blocks.

There is a free programming course here and the aia files for the projects in the book are here:

How to do a lot of basic things with App Inventor are described here: .

Also look here App inventor español. Offline. Tutorial. Ejemplos. Instalación. Códigos. Juegos. Curso gratis de App inventor. and here for more tutorials.

Use Taifun’s File Extension to rename the file with the Move blocks (or make a copy with the Copy blocks)

1 Like

hello again thanks for ur help.
u stated that all phones Pixel dimensions are the same on all devices (ignoring screen density).
what is the pixel dimensions for all phones?

What I meant is if you have an object (an image perhaps) that is 100Hx100W pixels, the image will display at normal size as 100x100 on a device (provided you do not alter it with code). It will always fill 100x100 pixels on that device. The image will appear larger or smaller depending on screen density and the device although the image will maintain the same resolution.

Different devices have Screen sizes in pixels that do vary.

  • 320dp: a typical phone screen (240x320 ldpi, 320x480 mdpi, 480x800 hdpi, etc).
  • 480dp: a large phone screen ~5" (480x800 mdpi).
  • 600dp: a 7” tablet (600x1024 mdpi).
  • 720dp: a 10” tablet (720x1280 mdpi, 800x1280 mdpi, etc).

depending on the screen density (dp)

Screen Size

How to handle Universal Screen Size.