Solved

vb.net - show date of picture taken

Posted on 2011-03-01
3
1,545 Views
Last Modified: 2012-05-11
hello there,
I have a photo taken with my canon camera and in details it shows it was taken in June 10th, 2010..
I would like to make a button that can show me that date.. how can I do that?
0
Comment
Question by:XK8ER
  • 2
3 Comments
 
LVL 85

Expert Comment

by:Mike Tomlinson
ID: 35010657
0
 
LVL 23

Accepted Solution

by:
wdosanjos earned 500 total points
ID: 35010796
It would be something like this:

        Const DATE_TAKEN As Integer = &H9003
        Dim img As Image = Image.FromFile("C:\IMG00001.jpg")
        Dim dateTaken As String

        If img.PropertyIdList.Contains(DATE_TAKEN) Then
            Dim pitem As PropertyItem
            pitem = img.GetPropertyItem(DATE_TAKEN)
            dateTaken = Encoding.UTF8.GetString(pitem.Value, 0, pitem.Value.Length)
        Else
            dateTaken = "Not available"
        End If

        Console.WriteLine("Date Taken: {0}", dateTaken)

Open in new window


Check the following link for other property codes:
http://msdn.microsoft.com/en-us/library/xddt0dz7.aspx
0
 
LVL 85

Expert Comment

by:Mike Tomlinson
ID: 35011032
The CodeProject link I posted basically wraps that into a nice class.

If you follow the link,  click on the "Browse Code" Tab near the top, and select "ExifReader.vb", you can see hundreds more of the tag codes have been entered for you.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…

864 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now