.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
abhays
Clintonzz
arronlee
mattyclown
cathyhill345

Home >> Code Snippets >> ASP.NET Controls >> Post New Resource Bookmark and Share   

 Subscribe to Code Snippets

Get Image Properties from a Selected Image using FileUpload Control

Posted By:Hefin Dsouza       Posted Date: August 12, 2009    Points: 10    Category: ASP.NET Controls    URL: http://hefindsouza.blog.com  
 

This simple Code will allow you to view diffrent properties of an selected image..
Example The Dimension,Pixel etc


Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
FileUpload1.SaveAs(Server.MapPath("a.jpg"))
Dim a As New Bitmap(Server.MapPath("a.jpg"))
Image1.ImageUrl = Server.MapPath("a.jpg")
Response.Write("
Image Properties")
Response.Write("
Physical Height : " & a.PhysicalDimension.Height)
Response.Write("
Physical Width : " & a.PhysicalDimension.Width)
Response.Write("
Pixel Format : " & a.PixelFormat.ToString())
Response.Write("
Raw Format : " & a.RawFormat.ToString)
End Sub
================================================================================
Regards Hefin Dsouza
================================================================================

     

Further Readings:

Responses

No response found. Be the first to respond this post

Post Comment

You must Sign In To post reply
Find More code samples in C#, ASP.Net, Vb.Net and more Here

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend