BitmapMetadata.DateTaken Property
.NET Framework 4.5
Gets or sets a value that indicates the date that the image was taken.
Namespace: System.Windows.Media.Imaging
Assembly: PresentationCore (in PresentationCore.dll)
XMLNS for XAML: http://schemas.microsoft.com/winfx/2006/xaml/presentation, http://schemas.microsoft.com/netfx/2007/xaml/presentation
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, _ decoder2.Frames(0).ColorContexts)) encoder3.Save(stream3) stream3.Close()
Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.