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 

TImage->Width and TImage->Picture->Width

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (VCL Components Usage)
View previous topic :: View next topic  
Author Message
Ami
Guest





PostPosted: Mon May 21, 2007 8:10 am    Post subject: TImage->Width and TImage->Picture->Width Reply with quote



Hi, what is the different between -

TImage->Width

and

TImage->Picture->Width ?

I set "TImage->Width" to the size that I want, but when I try to
save it to file -

TImage->Picture->SaveToFile( SavingPath );

the result file is Larger than the size that I set! when I
checked in the debuger I noticed that "TImage->Picture->Width"
is larger than "TImage->Width", why does it happen? and how can
I fix it so that the saved BMP file will be in the size that I
set in the "TImage->Width"? (which is the size that I see on the
form)

Thanks.
Back to top
Remy Lebeau (TeamB)
Guest





PostPosted: Mon May 21, 2007 1:19 pm    Post subject: Re: TImage->Width and TImage->Picture->Width Reply with quote



"Ami" <Ami123 (AT) hotmain (DOT) com> wrote in message
news:465145d0$1 (AT) newsgroups (DOT) borland.com...

Quote:
Hi, what is the different between -

TImage->Width

and

TImage->Picture->Width ?

The first is the width of the TImage itself. The second is the width
of the image that the TImage contains. The two are not the same. A
TImage can contain an image that is a different size than what the
TImage is set to display. TImage can display the image as-is, or it
can display the image stretched to fit TImage's size.

Quote:
I set "TImage->Width" to the size that I want, but when I
try to save it to file -

TImage->Picture->SaveToFile( SavingPath );

the result file is Larger than the size that I set!

All you are setting is the TImage's display size. That has no effect
on the underlying image that is being displayed/saved. When you save
the Picture, you are saving the actual image itself, not the TImage.

Quote:
when I checked in the debuger I noticed that
"TImage->Picture->Width"
is larger than "TImage->Width", why does it happen?

Because it can. The two sizes have nothing to do with each other.

Quote:
how can I fix it so that the saved BMP file will be in the size that
I set in the "TImage->Width"? (which is the size that I see on the
form)

You have to allocate a separate bitmap of the desired size and then
copy/stretch the original bitmap to it. That has nothing to do with
TImage.


Gambit
Back to top
Ami
Guest





PostPosted: Mon May 21, 2007 3:01 pm    Post subject: Re: TImage->Width and TImage->Picture->Width Reply with quote



Thanks very much! Smile
Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (VCL Components Usage) 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.