Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Resizing an image 1

Status
Not open for further replies.

stx

Programmer
Sep 24, 2002
62
BE
Hi,

I have a picturebox on my form. By using the common dialog the user can select an image which i then show in my picturebox.

Now i want to know how i can automatically resize the selected image to fit the picturebox and not the other way around.(not the picturebox to fit the size of the image)

Has anyone already done something like this?

plz help.
thnx
 
Maybe thread222-58793 will help (which hints on using an Image Control...)

Otherwise, you'll have to rescale the picture manually using the PictureBox1.Picture.ScaleHeight & .ScaleWidth properties.

I found that after rescaling the picture to fit the contril, it is necessary to resize the control to match the picture, otherwise some blurred information stays on the form...
Diederik
 
thnx guys

I used a picturebox instead of an imagebox.
Problems solved.

thnx again
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top