 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Ami Guest
|
Posted: Mon May 21, 2007 8:10 am Post subject: TImage->Width and TImage->Picture->Width |
|
|
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
|
Posted: Mon May 21, 2007 1:19 pm Post subject: Re: TImage->Width and TImage->Picture->Width |
|
|
"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
|
Posted: Mon May 21, 2007 3:01 pm Post subject: Re: TImage->Width and TImage->Picture->Width |
|
|
Thanks very much!  |
|
| 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
|
|