InPlaceBitmapMetadataWriter Class
Enables in-place updates to existing blocks of BitmapMetadata.
System.Windows.Threading.DispatcherObject
System.Windows.DependencyObject
System.Windows.Freezable
System.Windows.Media.ImageMetadata
System.Windows.Media.Imaging.BitmapMetadata
System.Windows.Media.Imaging.InPlaceBitmapMetadataWriter
Namespace: System.Windows.Media.Imaging
Assembly: PresentationCore (in PresentationCore.dll)
The InPlaceBitmapMetadataWriter type exposes the following members.
| Name | Description | |
|---|---|---|
![]() | ApplicationName | Gets or sets a value that identifies the name of the application that was used to construct or alter an image file. (Inherited from BitmapMetadata.) |
![]() | Author | Gets or sets a value that represents the author of an image. (Inherited from BitmapMetadata.) |
![]() | CameraManufacturer | Gets or sets a value that identifies the camera manufacturer that is associated with an image. (Inherited from BitmapMetadata.) |
![]() | CameraModel | Gets or sets a value that identifies the camera model that was used to capture the image. (Inherited from BitmapMetadata.) |
![]() | CanFreeze | Gets a value that indicates whether the object can be made unmodifiable. (Inherited from Freezable.) |
![]() | Comment | Gets or sets a value that represents a comment that is associated with the image file. (Inherited from BitmapMetadata.) |
![]() | Copyright | Gets or sets a value that indicates copyright information that is associated with the image file. (Inherited from BitmapMetadata.) |
![]() | DateTaken | Gets or sets a value that indicates the date that the image was taken. (Inherited from BitmapMetadata.) |
![]() | DependencyObjectType | Gets the DependencyObjectType that wraps the CLR type of this instance. (Inherited from DependencyObject.) |
![]() | Dispatcher | Gets the Dispatcher this DispatcherObject is associated with. (Inherited from DispatcherObject.) |
![]() | Format | Gets a value that identifies the format of the image. (Inherited from BitmapMetadata.) |
![]() | IsFixedSize | Gets a value that determines whether the BitmapMetadata object is a fixed size. (Inherited from BitmapMetadata.) |
![]() | IsFrozen | Gets a value that indicates whether the object is currently modifiable. (Inherited from Freezable.) |
![]() | IsReadOnly | Gets a value that indicates whether the metadata that is associated with an image is read-only. (Inherited from BitmapMetadata.) |
![]() | IsSealed | Gets a value that indicates whether this instance is currently sealed (read-only). (Inherited from DependencyObject.) |
![]() | Keywords | Gets or sets a collection of keywords that describe the bitmap image. (Inherited from BitmapMetadata.) |
![]() | Location | Gets a value that identifies the base location of the metadata that is associated with an image. (Inherited from BitmapMetadata.) |
![]() | Rating | Gets or sets a value that identifies the image rating. (Inherited from BitmapMetadata.) |
![]() | Subject | Gets or sets a value that indicates the subject matter of the bitmap image. (Inherited from BitmapMetadata.) |
![]() | Title | Gets or sets a value that identifies the title of an image file. (Inherited from BitmapMetadata.) |
| Name | Description | |
|---|---|---|
![]() | CheckAccess | Determines whether the calling thread has access to this DispatcherObject. (Inherited from DispatcherObject.) |
![]() | ClearValue(DependencyProperty) | Clears the local value of a property. The property to be cleared is specified by a DependencyProperty identifier. (Inherited from DependencyObject.) |
![]() | ClearValue(DependencyPropertyKey) | Clears the local value of a read-only property. The property to be cleared is specified by a DependencyPropertyKey. (Inherited from DependencyObject.) |
![]() | Clone | Creates a modifiable clone of this InPlaceBitmapMetadataWriter, making deep copies of this object's values. When copying dependency properties, this method copies resource references and data bindings (but they might no longer resolve) but not animations or their current values. |
![]() | CloneCurrentValue | Creates a modifiable clone (deep copy) of the Freezable using its current values. (Inherited from Freezable.) |
![]() | CoerceValue | Coerces the value of the specified dependency property. This is accomplished by invoking any CoerceValueCallback function specified in property metadata for the dependency property as it exists on the calling DependencyObject. (Inherited from DependencyObject.) |
![]() | ContainsQuery | Determines whether a given query string exists within a BitmapMetadata object. (Inherited from BitmapMetadata.) |
![]() | Equals | Determines whether a provided DependencyObject is equivalent to the current DependencyObject. (Inherited from DependencyObject.) |
![]() | Freeze() | Makes the current object unmodifiable and sets its IsFrozen property to true. (Inherited from Freezable.) |
![]() | GetAsFrozen | Creates a frozen copy of the Freezable, using base (non-animated) property values. Because the copy is frozen, any frozen sub-objects are copied by reference. (Inherited from Freezable.) |
![]() | GetCurrentValueAsFrozen | Creates a frozen copy of the Freezable using current property values. Because the copy is frozen, any frozen sub-objects are copied by reference. (Inherited from Freezable.) |
![]() | GetHashCode | Gets a hash code for this DependencyObject. (Inherited from DependencyObject.) |
![]() | GetLocalValueEnumerator | Creates a specialized enumerator for determining which dependency properties have locally set values on this DependencyObject. (Inherited from DependencyObject.) |
![]() | GetQuery | Provides access to a metadata query reader that can extract metadata from a bitmap image file. (Inherited from BitmapMetadata.) |
![]() | GetType | Gets the Type of the current instance. (Inherited from Object.) |
![]() | GetValue | Returns the current effective value of a dependency property on this instance of a DependencyObject. (Inherited from DependencyObject.) |
![]() | InvalidateProperty | Re-evaluates the effective value for the specified dependency property (Inherited from DependencyObject.) |
![]() | ReadLocalValue | Returns the local value of a dependency property, if it exists. (Inherited from DependencyObject.) |
![]() | RemoveQuery | Removes a metadata query from an instance of BitmapMetadata. (Inherited from BitmapMetadata.) |
![]() | SetCurrentValue | Sets the value of a dependency property without changing its value source. (Inherited from DependencyObject.) |
![]() | SetQuery | Provides access to a metadata query writer that can write metadata to a bitmap image file. (Inherited from BitmapMetadata.) |
![]() | SetValue(DependencyProperty, Object) | Sets the local value of a dependency property, specified by its dependency property identifier. (Inherited from DependencyObject.) |
![]() | SetValue(DependencyPropertyKey, Object) | Sets the local value of a read-only dependency property, specified by the DependencyPropertyKey identifier of the dependency property. (Inherited from DependencyObject.) |
![]() | ShouldSerializeProperty | Returns a value that indicates whether serialization processes should serialize the value for the provided dependency property. (Inherited from DependencyObject.) |
![]() | ToString | Returns a string that represents the current object. (Inherited from Object.) |
![]() | TrySave | Gets a value that indicates whether image metadata can be saved successfully. |
![]() | VerifyAccess | Enforces that the calling thread has access to this DispatcherObject. (Inherited from DispatcherObject.) |
| Name | Description | |
|---|---|---|
![]() ![]() | IEnumerable<String>.GetEnumerator | Infrastructure. For a description of this member, see IEnumerable<T>.GetEnumerator. (Inherited from BitmapMetadata.) |
![]() ![]() | IEnumerable.GetEnumerator | Infrastructure. For a description of this member, see IEnumerable.GetEnumerator. (Inherited from BitmapMetadata.) |
If BitmapMetadata is not associated with a BitmapFrame that is obtained through a BitmapDecoder, the attempt to write metadata by using the in-place writer will fail. Successful write operations apply the metadata directly to the image stream by means of a decoder.
In-place metadata updates fail if an attempt is made to write metadata that a given bitmap format does not support.
To perform in-place metadata edits, the bitmap must be decoded using either the Default or OnDemand cache options. OnLoad does not guarantee access to the metadata stream needed for in-place metadata edits.
This example shows how you can modify metadata within an image without having to re-encode the image. The following example uses an InPlaceBitmapMetadataWriter to write metadata into an image.
Stream pngStream = new System.IO.FileStream("smiley.png", FileMode.Open, FileAccess.ReadWrite, FileShare.ReadWrite); PngBitmapDecoder pngDecoder = new PngBitmapDecoder(pngStream, BitmapCreateOptions.PreservePixelFormat, BitmapCacheOption.Default); BitmapFrame pngFrame = pngDecoder.Frames[0]; InPlaceBitmapMetadataWriter pngInplace = pngFrame.CreateInPlaceBitmapMetadataWriter(); if (pngInplace.TrySave() == true) { pngInplace.SetQuery("/Text/Description", "Have a nice day."); } pngStream.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.
