Is there any TXImage method for resizing JPG image according to the pixel aspect ratio without losing image quality. I had an image with width 2821 pixel and height 2620 pixel and I need to resize it into 640*400 pixel
Regards
Sanil
oImage := GdiBmp():New( "file1.jpg" )
oImage:Resize( nWidth, nHeight )
oImage:Save( "newfile.jpg", nQuality )
oImage:End()
nageswaragunupudi wrote:If you want to resize a jpeg image and save it, you may try GdiBmp class instead. Here is a sample you may try:
- Code: Select all Expand view
oImage := GdiBmp():New( "file1.jpg" )
oImage:Resize( nWidth, nHeight )
oImage:Save( "newfile.jpg", nQuality )
oImage:End()
Please also note that you never need to resize any images if the purpose is only to display in any control of FWH
nageswaragunupudi wrote:
Following functions/methods automatically resize retaining the aspect ratio.
ResizeBitmap( hBitmap, nWidth, nHeight ) --> hNewResizedBitmap
You provide either width or height and leave the other as nil. Result is a resized bitmap retaining the aspect ratio.
In the above example you can use oImg:Resize( nWidth ). The method calculates the height retaining the aspect ratio,
Note: oImg:Resize( nil, nHeight ) also should work similarly but there is a bug in the method.
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: No registered users and 78 guests