BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Resize a bitmap

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (Graphics)
View previous topic :: View next topic  
Author Message
Alfred Thomas
Guest





PostPosted: Wed Oct 19, 2005 2:20 pm    Post subject: Resize a bitmap Reply with 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. 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





PostPosted: Wed Oct 19, 2005 6:16 pm    Post subject: Re: Resize a bitmap Reply with quote



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





PostPosted: Thu Oct 20, 2005 7:48 am    Post subject: Re: Resize a bitmap Reply with quote




Hi Michel

Thank you, that was exactly what I needed.

Michel Leunen <nospam (AT) noreply (DOT) please> wrote:
Quote:
Look at this thread with sample from Damon Chandler :
http://tinyurl.com/8u2cd



Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (Graphics) All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.