ColorTranslator.ToOle(Color) メソッド
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
指定した Color 構造体を OLE カラーに変換します。
public:
static int ToOle(System::Drawing::Color c);
public static int ToOle (System.Drawing.Color c);
static member ToOle : System.Drawing.Color -> int
Public Shared Function ToOle (c As Color) As Integer
パラメーター
戻り値
OLE カラー値。
例
次の例は、Windows フォームで使用するように設計されており、イベント ハンドラーのPaintパラメーターである が必要PaintEventArgse
です。 このコードは、 Color OLE の色を表す整数に構造体を変換し、結果の文字列を含むメッセージ ボックスを表示します。
public:
void ToOle_Example( PaintEventArgs^ /*e*/ )
{
// Create an instance of a Color structure.
Color myColor = Color::Red;
// Translate myColor to an OLE color.
int oleColor = ColorTranslator::ToOle( myColor );
// Show a message box with the value of oleColor.
MessageBox::Show( oleColor.ToString() );
}
public void ToOle_Example(PaintEventArgs e)
{
// Create an instance of a Color structure.
Color myColor = Color.Red;
// Translate myColor to an OLE color.
int oleColor = ColorTranslator.ToOle(myColor);
// Show a message box with the value of oleColor.
MessageBox.Show(oleColor.ToString());
}
Public Sub ToOle_Example(ByVal e As PaintEventArgs)
' Create an instance of a Color structure.
Dim myColor As Color = Color.Green
' Translate myColor to an OLE color.
Dim oleColor As Integer = ColorTranslator.ToOle(myColor)
' Show a message box with the value of htmlColor.
MessageBox.Show(oleColor.ToString())
End Sub
適用対象
GitHub で Microsoft と共同作業する
このコンテンツのソースは GitHub にあります。そこで、issue や pull request を作成および確認することもできます。 詳細については、共同作成者ガイドを参照してください。
.NET
フィードバック
https://aka.ms/ContentUserFeedback」を参照してください。
以下は間もなく提供いたします。2024 年を通じて、コンテンツのフィードバック メカニズムとして GitHub の issue を段階的に廃止し、新しいフィードバック システムに置き換えます。 詳細については、「フィードバックの送信と表示