PC SOFT

PROFESSIONAL NEWSGROUPS
WINDEVWEBDEV and WINDEV Mobile

Home → WINDEV (earlier versions) → [WM17] Andriod Resize Image ?
[WM17] Andriod Resize Image ?
Started by Danny Lauwers, Apr., 11 2013 12:37 PM - 1 reply
Posted on April, 11 2013 - 12:37 PM
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
Registered member
6 messages
Posted on February, 27 2014 - 4:28 AM
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.