PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WINDEV (précédentes versions) → [WM17] Andriod Resize Image ?
[WM17] Andriod Resize Image ?
Débuté par Danny Lauwers, 11 avr. 2013 12:37 - 1 réponse
Posté le 11 avril 2013 - 12:37
Hi,

What I want to accomplish:
1. Take a picture with the android camera
2. Resize it without distorting the image (Homothetic)
3. Upload via a Webservice to my ERP system

Where is the problem, in 2 resizing it !!

When the image of the camera is taken with VideoStartApp(viPictureCapture) the picture is stored in a JPG file. I assign the Image control to the path to load the image into the control and show it on the Andriod Phone. Looks good, works great !

Then I need to resize the image en compress it.
I tried

dResize(IMG_Foto,640,480)
bufImageBuffer = dSaveImageJPG(IMG_Temp,inMemory,50)
sBase64String = Crypt(bufImageBuffer,"",cryptNone,True)

Once I have a Base64String I can upload it without problems.

The result I get is a picture with black borders around it
[attachment 302 test.jpg]

If you save the image of a Image control, it seems to save the total control and not only the image itself.

I tried the same with Windev 17, and there I have used the Image variable and that works OK.

I also tried to use a second Image control of the same size what I want to resize, but this has a double black border around it ??

Anybody an idea on how to correct size an image taken from the android camera ?

Thanks
Danny
Membre enregistré
6 messages
Posté le 27 février 2014 - 04:28
I have only tried to resize images using the 3rd party image resizers before:
http://www.yiigo.com/guides/vbnet/how-to-resize-image.shtml
But I have no experience on how to correct size an image taken from the android camera.