Image sizing problem

Please discuss general Delphi programming topics here.

Image sizing problem

Postby martincg » May 7th, 2006, 12:15 am

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?
martincg
Active Member
Active Member
 
Posts: 10
Joined: April 22nd, 2006, 11:13 am

Postby Kambiz » May 7th, 2006, 1:35 pm

You should set the size of Pic.Picture.Bitmap property.
Kambiz
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2421
Joined: March 7th, 2003, 7:10 pm

Postby martincg » May 8th, 2006, 1:37 pm

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.
martincg
Active Member
Active Member
 
Posts: 10
Joined: April 22nd, 2006, 11:13 am


Return to Delphi Programming

Who is online

Users browsing this forum: No registered users and 1 guest

cron