Page 1 of 1

Image sizing problem

PostPosted: May 7th, 2006, 12:15 am
by martincg
I create an image
Pic := TImage.Create(self) etc

then I draw a something on it

Later I want to resize it and draw something else on it.
I resize by writing
Pic.height := new height;
Pic.width := newwidth;

But when I draw on it only the original size of the image is drawn on, - the canvas apparently doesn't grow. So the only way I can get what I want is to delete the image and create a new one.

Can anyone tell me what I should do?

PostPosted: May 7th, 2006, 1:35 pm
by Kambiz
You should set the size of Pic.Picture.Bitmap property.

PostPosted: May 8th, 2006, 1:37 pm
by martincg
Thanks Kambiz- that fixes it.
When I stretch an image which contains a bitmap loaded from file I don't need to change the Pic.PIcture.Bitmap.heigth/Width so I assume it must be automatic in that case.