Atlanta Custom Software Development 

 
   Search        Code/Page
 

User Login
Email

Password

 

Forgot the Password?
Services
» Web Development
» Maintenance
» Data Integration/BI
» Information Management
Programming
  Database
Automation
OS/Networking
Graphics
Links
Tools
» Regular Expr Tester
» Free Tools


Click here to copy the following block
' Return the format of the input image, according on its extension
' Example: Dim imgFormat As System.Drawing.imaging.ImageFormat = GetImageFormat
' ("D:\sample.gif")

Function GetImageFormat(ByVal imgPath As String) As _
  System.Drawing.imaging.ImageFormat
  imgPath = imgPath.ToLower()
  If imgPath.EndsWith(".bmp") Then
    Return System.Drawing.Imaging.ImageFormat.Bmp
  ElseIf imgPath.EndsWith(".emf") Then
    Return System.Drawing.Imaging.ImageFormat.Emf
  ElseIf imgPath.EndsWith(".gif") Then
    Return System.Drawing.Imaging.ImageFormat.Gif
  ElseIf imgPath.EndsWith(".ico") Then
    Return System.Drawing.Imaging.ImageFormat.Icon
  ElseIf imgPath.EndsWith(".jpg") OrElse imgPath.EndsWith(".jpeg") Then
    Return System.Drawing.Imaging.ImageFormat.Jpeg
  ElseIf imgPath.EndsWith(".png") Then
    Return System.Drawing.Imaging.ImageFormat.Png
  ElseIf imgPath.EndsWith(".tif") OrElse imgPath.EndsWith(".tiff") Then
    Return System.Drawing.Imaging.ImageFormat.Tiff
  ElseIf imgPath.EndsWith(".wmf") Then
    Return System.Drawing.Imaging.ImageFormat.Wmf
  Else
    Return System.Drawing.Imaging.ImageFormat.Gif
  End If
End Function


Submitted By : Nayan Patel  (Member Since : 5/26/2004 12:23:06 PM)

Job Description : He is the moderator of this site and currently working as an independent consultant. He works with VB.net/ASP.net, SQL Server and other MS technologies. He is MCSD.net, MCDBA and MCSE. In his free time he likes to watch funny movies and doing oil painting.
View all (893) submissions by this author  (Birth Date : 7/14/1981 )


Home   |  Comment   |  Contact Us   |  Privacy Policy   |  Terms & Conditions   |  BlogsZappySys

© 2008 BinaryWorld LLC. All rights reserved.