Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

length and width of an image

Posted on 2005-03-27
3
Medium Priority
?
167 Views
Last Modified: 2010-04-23

Does anyone have some code to determine the length and width of an image?

0
Comment
Question by:brokeMyLegBiking
3 Comments
 
LVL 14

Expert Comment

by:amyhxu
ID: 13641601
Is this working for you?
    Dim image As System.Drawing.Image
    image = ...... 'Some image file

   Dim width As Integer = image.Width
   Dim height As Integer = image.Height
0
 
LVL 10

Expert Comment

by:anv
ID: 13641790
u need to set the PictureBox controls SizeMode to Autosize..and then try this..

MessageBox.Show(pictureBox1.Width.ToString() + " " + pictureBox1.Height.ToString());

0
 
LVL 86

Accepted Solution

by:
Mike Tomlinson earned 2000 total points
ID: 13642434
Use the FromFile() method to load the image first:

    Dim img As Image = Image.FromFile("c:\someFile.someExtension")
    Dim width As Integer = img.Width()
    Dim height As Integer = img.Height()
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
Suggested Courses

581 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question