次の方法で共有


ImageConverter.ConvertTo メソッド (ITypeDescriptorContext, CultureInfo, Object, Type)

Image (または、Image にキャストできるオブジェクト) を指定した型に変換します。

Overrides Overloads Public Function ConvertTo( _
   ByVal context As ITypeDescriptorContext, _   ByVal culture As CultureInfo, _   ByVal value As Object, _   ByVal destinationType As Type _) As Object
[C#]
public override object ConvertTo(ITypeDescriptorContextcontext,CultureInfoculture,objectvalue,TypedestinationType);
[C++]
public: Object* ConvertTo(ITypeDescriptorContext* context,CultureInfo* culture,Object* value,Type* destinationType);
[JScript]
public override function ConvertTo(
   context : ITypeDescriptorContext,culture : CultureInfo,value : Object,destinationType : Type) : Object;

パラメータ

  • context
    書式指定コンテキスト。このオブジェクトを使用して、このコンバータを呼び出している環境についての追加情報を取得できます。この値は null 参照 (Visual Basic では Nothing) になる場合があるため、常に確認してください。また、コンテキスト オブジェクトのプロパティも null 参照 (Nothing) を返す場合があります。
  • culture
    特定のカルチャで使用される書式指定規約を指定する CultureInfo オブジェクト。
  • value
    変換対象の Image
  • destinationType
    Image を変換した後の Type

戻り値

このメソッドは、変換されたオブジェクトを返します。

解説

型変換として最もよく使用されるのは、文字列型からの変換およびその逆の変換です。変換対象のオブジェクトが有効で、変更後の型が文字列の場合、既定の実装はオブジェクトの ToString メソッドを呼び出します。指定のオブジェクトを目的の型に変換できない場合、このメソッドは NotSupportedException 例外をスローします。

必要条件

プラットフォーム: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 ファミリ

参照

ImageConverter クラス | ImageConverter メンバ | System.Drawing 名前空間 | ImageConverter.ConvertTo オーバーロードの一覧