ColorTranslator.FromOle(Int32) Metodo
Definizione
Importante
Alcune informazioni sono relative alla release non definitiva del prodotto, che potrebbe subire modifiche significative prima della release definitiva. Microsoft non riconosce alcuna garanzia, espressa o implicita, in merito alle informazioni qui fornite.
Converte un valore di colore OLE in una struttura Color GDI+.
public:
static System::Drawing::Color FromOle(int oleColor);
public static System.Drawing.Color FromOle (int oleColor);
static member FromOle : int -> System.Drawing.Color
Public Shared Function FromOle (oleColor As Integer) As Color
Parametri
- oleColor
- Int32
Colore OLE da convertire.
Restituisce
Struttura Color che rappresenta il colore OLE convertito.
Esempio
L'esempio seguente è progettato per l'uso con Windows Forms e richiede PaintEventArgse
, che è un parametro del Paint gestore eventi. Il codice converte un valore di colore OLE in una Color struttura e quindi usa tale colore per riempire un rettangolo.
public:
void FromOle_Example( PaintEventArgs^ e )
{
// Create an integer representation of an OLE color.
int oleColor = 0xFF00;
// Translate oleColor to a GDI+ Color structure.
Color myColor = ColorTranslator::FromOle( oleColor );
// Fill a rectangle with myColor.
e->Graphics->FillRectangle( gcnew SolidBrush( myColor ), 0, 0, 100, 100 );
}
public void FromOle_Example(PaintEventArgs e)
{
// Create an integer representation of an OLE color.
int oleColor = 0xFF00;
// Translate oleColor to a GDI+ Color structure.
Color myColor = ColorTranslator.FromOle(oleColor);
// Fill a rectangle with myColor.
e.Graphics.FillRectangle( new SolidBrush(myColor), 0, 0,
100, 100);
}
Public Sub FromOle_Example(ByVal e As PaintEventArgs)
' Create an integer representation of an HTML color.
Dim oleColor As Integer = &HFF00
' Translate oleColor to a GDI+ Color structure.
Dim myColor As Color = ColorTranslator.FromOle(oleColor)
' Fill a rectangle with myColor.
e.Graphics.FillRectangle(New SolidBrush(myColor), 0, 0, 100, 100)
End Sub
Si applica a
Commenti e suggerimenti
https://aka.ms/ContentUserFeedback.
Presto disponibile: Nel corso del 2024 verranno gradualmente disattivati i problemi di GitHub come meccanismo di feedback per il contenuto e ciò verrà sostituito con un nuovo sistema di feedback. Per altre informazioni, vedereInvia e visualizza il feedback per