BitmapMetadata.DateTaken Property


The .NET API Reference documentation has a new home. Visit the .NET API Browser on to see the new experience.

Gets or sets a value that indicates the date that the image was taken.

Namespace:   System.Windows.Media.Imaging
Assembly:  PresentationCore (in PresentationCore.dll)

Public Property DateTaken As String

Property Value

Type: System.String

The date that the image was taken.

The following code example shows how to write metadata to a bitmap image by using friendly properties of the BitmapMetadata class.

Dim stream3 As New FileStream("image2.tif", FileMode.Create)
Dim myBitmapMetadata As New BitmapMetadata("tiff")
Dim encoder3 As New TiffBitmapEncoder()
myBitmapMetadata.ApplicationName = "Microsoft Digital Image Suite 10"
myBitmapMetadata.Author = New ReadOnlyCollection(Of String) _
    (New List(Of String)(New String() {"Lori Kane"}))
myBitmapMetadata.CameraManufacturer = "Tailspin Toys"
myBitmapMetadata.CameraModel = "TT23"
myBitmapMetadata.Comment = "Nice Picture"
myBitmapMetadata.Copyright = "2010"
myBitmapMetadata.DateTaken = "5/23/2010"
myBitmapMetadata.Keywords = New ReadOnlyCollection(Of String) _
    (New List(Of String)(New String() {"Lori", "Kane"}))
myBitmapMetadata.Rating = 5
myBitmapMetadata.Subject = "Lori"
myBitmapMetadata.Title = "Lori's photo"

' Create a new frame that is identical to the one 
' from the original image, except for the new metadata. 
encoder3.Frames.Add( _
    BitmapFrame.Create(decoder2.Frames(0), _
    decoder2.Frames(0).Thumbnail, _
    myBitmapMetadata, _


.NET Framework
Available since 3.0
Return to top