Jump to content
Xtreme .Net Talk

Recommended Posts

Guest mcerk
Posted

picturebox

 

is it possible, to fit a picture to a picturebox without straching it?

 

I want to maintain proporcions, and change the size of the picture.

Guest mcerk
Posted

Hi, I posted this post on .net forum and I'm not sure that I posted it into right forum

 

anyway

 

is it possible, to fit a picture to a picturebox without straching it?

 

 

 

I want to maintain proporcions, and change the size of the picture.

 

Divil told me to use Image Constructor to change size of the picture.

 

 

I solved this problem in VB6 by using 2 pictureboxes

picturebox1 (hidden, it adjusted to the picture size)

picturebox2(visible, had strech property on)

 

I loaded picture into hidden form and figured out the size of image in pixels (=size of hidden form). Then I changed the size of the picturebox1 that I maintained proportions of the picture and loaded this picture into it.

 

The only problem was, that this procedure vas VERY slow. I have quite large pictures, so loading every one, just to figure out it's size was waste of time.

 

 

 

Is there any faster procedure in vb.net?

 

 

PS, I looked into help for Image constructor, but I didnt get the point..

 

 

tx.

 

 

Matej

 

 

:-\

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...