Solved

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

Posted on 2004-09-23
5
304 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 500 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

Independent Software Vendors: 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

Suggested Solutions

Title # Comments Views Activity
CSS style formatting? 2 37
Responsive Font Size 6 49
How can I make a div layout like the one in the image 2 45
asp.net, radiobuttonlist, c# 3 39
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

730 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