Solved

vb.net - show date of picture taken

Posted on 2011-03-01
3
1,681 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
[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
  • 2
3 Comments
 
LVL 86

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 86

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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
This video Micro Tutorial shows how to password-protect PDF files with free software. Many software products can do this, such as Adobe Acrobat (but not Adobe Reader), Nuance PaperPort, and Nuance Power PDF, but they are not free products. This vide…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…

690 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