Solved

vb.net - show date of picture taken

Posted on 2011-03-01
3
1,602 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 Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Web Form VB.Net  import CSV 4 43
Help with consolidating excel files using VB.net 2 29
VB.net and sql server 4 45
Error message when using PrintSocket.Send 7 18
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…
I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

766 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