 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Alfred Thomas Guest
|
Posted: Wed Oct 19, 2005 2:20 pm Post subject: Resize a bitmap |
|
|
Hi all
I am writing a component that needs to read a JPEG into a TJpegImage, convert it to a TBitmap and then make part of the image smaller.
The problem is that when i do the resize, the resulting image quality is very bad. It seems as if the pixelFormat changed to 16bit, but I tried setting it to 24bit with no effect.
Here is the code I use to resize:
OffscreenImage->Width = sourceRect.Width() / scaleFactor;
OffscreenImage->Height = sourceRect.Height() / scaleFactor;
StretchBlt(OffscreenImage->Canvas->Handle, 0, 0,
OffscreenImage->Width, OffscreenImage->Height,
sourceRect.Top, sourceRect.Width(), sourceRect.Height(), SRCCOPY);
Any help would be appreciated.
Alfred
|
|
| Back to top |
|
 |
Michel Leunen Guest
|
Posted: Wed Oct 19, 2005 6:16 pm Post subject: Re: Resize a bitmap |
|
|
Alfred Thomas wrote:
| Quote: | Hi all
I am writing a component that needs to read a JPEG into a TJpegImage, convert it to a TBitmap and then make part of the image smaller.
The problem is that when i do the resize, the resulting image quality is very bad.
|
Look at this thread with sample from Damon Chandler :
http://tinyurl.com/8u2cd
Michel
--
----------------------------------------
Michel Leunen
mailto: see my homepage.
C++Builder, BCC5.5.1 Web site:
http://www.leunen.com/
----------------------------------------
|
|
| Back to top |
|
 |
Alfred Thomas Guest
|
Posted: Thu Oct 20, 2005 7:48 am Post subject: Re: Resize a bitmap |
|
|
Hi Michel
Thank you, that was exactly what I needed.
Michel Leunen <nospam (AT) noreply (DOT) please> wrote:
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|