PointConverter クラス
アセンブリ: System.Drawing (system.drawing.dll 内)
構文
使用例PointConverter と op_Subtraction 演算子を使用する方法を次のコード例に示します。この例は、Windows フォームでの使用を意図してデザインされています。このコードをフォームに貼り付け、フォームの Paint イベントを処理するときに PaintEventArgs の e を渡して ShowPointConverter メソッドを呼び出します。
Private Sub ShowPointConverter(ByVal e As PaintEventArgs) ' Create the PointConverter. Dim converter As System.ComponentModel.TypeConverter = _ System.ComponentModel.TypeDescriptor.GetConverter(GetType(Point)) Dim point1 As Point = _ CType(converter.ConvertFromString("200, 200"), Point) ' Use the subtraction operator to get a second point. Dim point2 As Point = Point.op_Subtraction(point1, _ New Size(190, 190)) ' Draw a line between the two points. e.Graphics.DrawLine(Pens.Black, point1, point2) End Sub
private void ShowPointConverter(PaintEventArgs e) { // Create the PointConverter. System.ComponentModel.TypeConverter converter = System.ComponentModel.TypeDescriptor.GetConverter(typeof(Point)); Point point1 = (Point) converter.ConvertFromString("200, 200"); // Use the subtraction operator to get a second point. Point point2 = point1 - new Size(190, 190); // Draw a line between the two points. e.Graphics.DrawLine(Pens.Black, point1, point2); }
void ShowPointConverter( PaintEventArgs^ e ) { // Create the PointConverter. System::ComponentModel::TypeConverter^ converter = System::ComponentModel::TypeDescriptor::GetConverter( Point::typeid ); Point point1 = *dynamic_cast<Point^>(converter->ConvertFromString( "200, 200" )); // Use the subtraction operator to get a second point. Point point2 = point1 - System::Drawing::Size( 190, 190 ); // Draw a line between the two points. e->Graphics->DrawLine( Pens::Black, point1, point2 ); }
private void ShowPointConverter(PaintEventArgs e) { // Create the PointConverter. PointConverter converter = new PointConverter(); Point point1 = (Point)converter.ConvertFromString("200, 200"); // Use the subtraction operator to get a second point. Point point2 = Point.op_Subtraction(point1 , new Size(190, 190)); // Draw a line between the two points. e.get_Graphics().DrawLine(Pens.get_Black(), point1, point2); } //ShowPointConverter
継承階層System.ComponentModel.TypeConverter
System.Drawing.PointConverter
スレッド セーフ
プラットフォームWindows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。
バージョン情報
参照PointConverter コンストラクタ
アセンブリ: System.Drawing (system.drawing.dll 内)
構文
プラットフォームWindows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。
バージョン情報
参照PointConverter メソッド
パブリック メソッド
プロテクト メソッド| 名前 | 説明 | |
|---|---|---|
| Finalize | Object がガベージ コレクションにより収集される前に、その Object がリソースを解放し、その他のクリーンアップ操作を実行できるようにします。 ( Object から継承されます。) |
| GetConvertFromException | 変換を実行できなかった場合にスローされる例外を返します。 ( TypeConverter から継承されます。) |
| GetConvertToException | 変換を実行できなかった場合にスローされる例外を返します。 ( TypeConverter から継承されます。) |
| MemberwiseClone | 現在の Object の簡易コピーを作成します。 ( Object から継承されます。) |
| SortProperties | プロパティのコレクションを並べ替えます。 ( TypeConverter から継承されます。) |
参照PointConverter メンバ
Point オブジェクトのデータ型を別のデータ型に変換します。TypeDescriptor オブジェクトを通じてこのクラスにアクセスします。
PointConverter データ型で公開されるメンバを以下の表に示します。
パブリック コンストラクタ
パブリック メソッド
プロテクト メソッド| 名前 | 説明 | |
|---|---|---|
| Finalize | Object がガベージ コレクションにより収集される前に、その Object がリソースを解放し、その他のクリーンアップ操作を実行できるようにします。 (Object から継承されます。) |
| GetConvertFromException | 変換を実行できなかった場合にスローされる例外を返します。 (TypeConverter から継承されます。) |
| GetConvertToException | 変換を実行できなかった場合にスローされる例外を返します。 (TypeConverter から継承されます。) |
| MemberwiseClone | 現在の Object の簡易コピーを作成します。 (Object から継承されます。) |
| SortProperties | プロパティのコレクションを並べ替えます。 (TypeConverter から継承されます。) |
参照- PointConverterのページへのリンク