ColorTranslator.ToWin32 メソッド
アセンブリ: System.Drawing (system.drawing.dll 内)

Dim c As Color Dim returnValue As Integer returnValue = ColorTranslator.ToWin32(c)
戻り値
Windows カラー値。

次の例は、Windows フォームでの使用を意図してデザインされており、Paint イベント ハンドラのパラメータである PaintEventArgse が必要です。このコードでは、Color 構造体を Windows カラーを表す整数に変換し、メッセージ ボックスにその文字列を表示します。
Public Sub ToWin32_Example(ByVal e As PaintEventArgs) ' Create an instance of a Color structure. Dim myColor As Color = Color.Red ' Translate myColor to an OLE color. Dim winColor As Integer = ColorTranslator.ToWin32(myColor) ' Show a message box with the value of winColor. MessageBox.Show(winColor) End Sub
public void ToWin32_Example(PaintEventArgs e) { // Create an instance of a Color structure. Color myColor = Color.Red; // Translate myColor to an OLE color. int winColor = ColorTranslator.ToWin32(myColor); // Show a message box with the value of winColor. MessageBox.Show(winColor.ToString()); }
public: void ToWin32_Example( PaintEventArgs^ /*e*/ ) { // Create an instance of a Color structure. Color myColor = Color::Red; // Translate myColor to an OLE color. int winColor = ColorTranslator::ToWin32( myColor ); // Show a message box with the value of winColor. MessageBox::Show( winColor.ToString() ); }
public void ToWin32_Example(PaintEventArgs e) { // Create an instance of a Color structure. Color myColor = Color.get_Red(); // Translate myColor to an OLE color. int winColor = ColorTranslator.ToWin32(myColor); // Show a message box with the value of winColor. MessageBox.Show(System.Convert.ToString(winColor)); } //ToWin32_Example

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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Weblioに収録されているすべての辞書からColorTranslator.ToWin32 メソッドを検索する場合は、下記のリンクをクリックしてください。

- ColorTranslator.ToWin32 メソッドのページへのリンク