FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Load, Resize and Save an Image
Posts: 1067
Joined: Wed Nov 09, 2005 02:17 AM
Load, Resize and Save an Image
Posted: Fri Aug 27, 2021 11:27 AM

Hi Guys,
What is the best way to load an image (JPG file), resize and save it ?

Sds,
Vilian F. Arraes
vilian@vfatec.com.br
Belém-Pa-Brazil
Posts: 1344
Joined: Wed Nov 16, 2005 09:14 PM
Re: Load, Resize and Save an Image
Posted: Fri Aug 27, 2021 07:53 PM

+1

Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Load, Resize and Save an Image
Posted: Sat Aug 28, 2021 02:32 AM
Code (fw): Select all Collapse
    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.
Regards



G. N. Rao.

Hyderabad, India
Posts: 1487
Joined: Tue Jun 14, 2016 07:51 AM
Re: Load, Resize and Save an Image
Posted: Sun Aug 29, 2021 08:52 AM
nageswaragunupudi wrote:
Code (fw): Select all Collapse
    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 ....?
Marc Venken

Using: FWH 23.08 with Harbour
Posts: 1067
Joined: Wed Nov 09, 2005 02:17 AM
Re: Load, Resize and Save an Image
Posted: Mon Aug 30, 2021 11:04 AM

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 ;)

Sds,
Vilian F. Arraes
vilian@vfatec.com.br
Belém-Pa-Brazil
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Load, Resize and Save an Image
Posted: Mon Aug 30, 2021 04:03 PM

fwh\source\function\imgtxtio.prg

Regards



G. N. Rao.

Hyderabad, India
Posts: 1067
Joined: Wed Nov 09, 2005 02:17 AM
Re: Load, Resize and Save an Image
Posted: Mon Aug 30, 2021 04:51 PM

Thank you ;)

Sds,
Vilian F. Arraes
vilian@vfatec.com.br
Belém-Pa-Brazil

Continue the discussion