Page 1 of 1

Load, Resize and Save an Image

Posted: Fri Aug 27, 2021 11:27 am
by vilian
Hi Guys,
What is the best way to load an image (JPG file), resize and save it ?

Re: Load, Resize and Save an Image

Posted: Fri Aug 27, 2021 7:53 pm
by cmsoft
+1

Re: Load, Resize and Save an Image

Posted: Sat Aug 28, 2021 2:32 am
by nageswaragunupudi

Code: Select all | Expand

   aBmp  := FW_ReadImage( nil, "c:\fwh\bitmaps\olga1.jpg", { 176, 225 } ) // Load resized image
   FW_SaveImage( aBmp[ 1 ], "olgasmal.jpg", 100 )
   PalBmpFree( aBmp )
 


Original size of olga1.jpg is 352x450 px. Loaded with size 176x225 and then saved.

Re: Load, Resize and Save an Image

Posted: Sun Aug 29, 2021 8:52 am
by Marc Venken
nageswaragunupudi wrote:

Code: Select all | Expand

   aBmp  := FW_ReadImage( nil, "c:\fwh\bitmaps\olga1.jpg", { 176, 225 } ) // Load resized image
   FW_SaveImage( aBmp[ 1 ], "olgasmal.jpg", 100 )
   PalBmpFree( aBmp )
 


Original size of olga1.jpg is 352x450 px. Loaded with size 176x225 and then saved.


Previous there has been issues about the saved quality. (time ago) Is this current way keeping the quality good ? Will test it, but general speeking ....?

Re: Load, Resize and Save an Image

Posted: Mon Aug 30, 2021 11:04 am
by vilian
Thank you Mr Rao ;)

Is there any doc with an explanation about this fw_ image functions and its parameters ?
I would like to know more about these functions ;)

Re: Load, Resize and Save an Image

Posted: Mon Aug 30, 2021 4:03 pm
by nageswaragunupudi
fwh\source\function\imgtxtio.prg

Re: Load, Resize and Save an Image

Posted: Mon Aug 30, 2021 4:51 pm
by vilian
Thank you ;)