Click here to Skip to main content
12,756,298 members (34,446 online)
Rate this:
Please Sign up or sign in to vote.
See more: VB VB.NET
I have searched over the web and i can't find an answer. How to resize a picture box to fit an image that loads a user?
Posted 19-Sep-12 4:33am
Wes Aday 19-Sep-12 9:41am
If you are resizing the picturebox, why can't you set the width and height?
Manfred R. Bihy 19-Sep-12 10:24am
My thoughts exactly!
Wes Aday 19-Sep-12 11:03am
Can't for the life of me figure out how this is a problem....

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

  1. Get an Image[^] loaded, maybe using Image.FromFile(String path)

  2. Use the Size property[^] of that loaded Image to get the dimensions in pixel

  3. Use your PictureBox's[^] Height and Width property to set the correct height and width you retrieved from the previous step.


— Manfred

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

    Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web01 | 2.8.170217.1 | Last Updated 19 Sep 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100