Solved

vb.net - show date of picture taken

Posted on 2011-03-01
3
1,496 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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

706 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

23 Experts available now in Live!

Get 1:1 Help Now