ColorTranslator.ToWin32 メソッドとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > ColorTranslator.ToWin32 メソッドの意味・解説 

ColorTranslator.ToWin32 メソッド

指定した Color 構造体Windows カラー変換します

名前空間: System.Drawing
アセンブリ: System.Drawing (system.drawing.dll 内)
構文構文

使用例使用例

次の例は、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
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照


このページでは「.NET Framework クラス ライブラリ リファレンス」からColorTranslator.ToWin32 メソッドを検索した結果を表示しています。
Weblioに収録されているすべての辞書からColorTranslator.ToWin32 メソッドを検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からColorTranslator.ToWin32 メソッド を検索

英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

ColorTranslator.ToWin32 メソッドのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



ColorTranslator.ToWin32 メソッドのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2025 Microsoft.All rights reserved.

©2025 GRAS Group, Inc.RSS