?
Solved

system.web.ui.htmlcontrols.htmlInputFile dpi and max length

Posted on 2004-09-23
5
Medium Priority
?
306 Views
Last Modified: 2012-08-13
Hi there,

I'm trying to find a way to get the dpi and maximum length (pixels a the longest end) of an image.

Currently I can use the file control to get the size as demonstrated below, but I can't figure out how to get the other attributes. I'm using VB.Net

filectrImageFile.PostedFile.ContentLength

Thanks!
0
Comment
Question by:Gezna
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
5 Comments
 
LVL 31

Expert Comment

by:seanpowell
ID: 12136830
Do you need the dpi to specify how it gets printed?
0
 
LVL 4

Expert Comment

by:itcnbwise
ID: 12140564
'## CHECK DIMENSIONS
Dim image As System.Drawing.Image = Nothing

image = System.Drawing.Image.FromStream(filectrImageFile.PostedFile.InputStream)
      Dim thisHeight As integer = image.height
      Dim thisWidth As integer = image.height

This will get you the width and height of the uploaded image.
0
 
LVL 4

Expert Comment

by:itcnbwise
ID: 12140574
I guess you could add these 2 lines to get DPI:

HorizontalResolution
0
 
LVL 4

Accepted Solution

by:
itcnbwise earned 2000 total points
ID: 12140582
I guess you could add these 2 lines to get DPI:

    Dim thisHorizRes As integer = image.HorizontalResolution
    Dim thisVertRes As integer = image.VerticalResolution

(sorry for all the crazy posts - but there's a typo in the earlier one:)
Dim thisWidth As integer = image.width
0
 

Author Comment

by:Gezna
ID: 12145818
Works like a charm! thanks!
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
Suggested Courses

771 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