Bewerken

Delen via


ImageSourceTypeConverter.ConvertTo Method

Definition

Converts a BitmapSource to an object of the specified type.

public:
 override System::Object ^ ConvertTo(System::ComponentModel::ITypeDescriptorContext ^ context, System::Globalization::CultureInfo ^ culture, System::Object ^ value, Type ^ destinationType);
[System.Security.SecurityCritical]
[System.Security.SecurityTreatAsSafe]
public override object ConvertTo (System.ComponentModel.ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destinationType);
[System.Security.SecurityTreatAsSafe]
public override object ConvertTo (System.ComponentModel.ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destinationType);
[<System.Security.SecurityCritical>]
[<System.Security.SecurityTreatAsSafe>]
override this.ConvertTo : System.ComponentModel.ITypeDescriptorContext * System.Globalization.CultureInfo * obj * Type -> obj
[<System.Security.SecurityTreatAsSafe>]
override this.ConvertTo : System.ComponentModel.ITypeDescriptorContext * System.Globalization.CultureInfo * obj * Type -> obj
Public Overrides Function ConvertTo (context As ITypeDescriptorContext, culture As CultureInfo, value As Object, destinationType As Type) As Object

Parameters

context
ITypeDescriptorContext

An object that provides contextual information.

culture
CultureInfo

The language and culture that are used during the conversion.

value
Object

The object that you want to convert.

destinationType
Type

The type that you want value converted to.

Returns

The new Object of the designated type. As implemented in this class, the object must be a Uri. The object expresses the uniform resource identifier (URI) of the serialized image.

Attributes

Exceptions

The destinationType is not a type that value can be converted to.

The context is null.

The value is null.

An error occurs when serializing the image.

Remarks

As implemented in this class, value must be a BitmapSource.

As implemented in this class, destinationType must be a Uri or the NotSupportedException is thrown.

The culture parameter is not used. See Notes for Inheritors.

Notes to Inheritors

Override this method to provide your own conversion. Use the culture parameter to specify the language and culture. Use the context parameter to extract additional information about the environment from which this converter is invoked. This parameter can be null; therefore, always check it. Also, properties on the context object can return a null reference (Nothing).

Applies to