Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

How to: tell pixel size of graphic image (i.e. jpg) to resize picbox

vbnvbn Posts: 60Member
The VB.net picturebox control supports image types of bmp, gif, ico, jpg, jff, wmf, emf.

How do I:

1) Find out the pixel size of these images?

2) Resize my picturebox if it's pixel size is to small to fully accommodate the image?

Many, many thanks!!!

Gary (vbn)

Comments

  • ansans Posts: 16Member
    I believe you can try this:

    picturebox1.SizeMode=PictureBoxSizeMode.AutoSize;

    'Autosize' causes the picturebox size to be made equal to the size of the image.This way ,you don't need to know the size of the image beforehand.

    On the other hand,to make the image size equal to the picturebox size,you can use PictureBoxSizeMode.StretchImage.This will adjust the image size and make it equal to the picturebox size.


Sign In or Register to comment.