Struttura ColorValueFixed
Aggiornamento: novembre 2007
Archivia, in una struttura in virgola fissa, i valori dei canali rosso, verde, blu e alfa che insieme definiscono un colore specifico.
Spazio dei nomi: Microsoft.WindowsMobile.DirectX.Direct3D
Assembly: Microsoft.WindowsMobile.DirectX (in Microsoft.WindowsMobile.DirectX.dll)
Sintassi
'Dichiarazione
Public Structure ColorValueFixed
'Utilizzo
Dim instance As ColorValueFixed
public struct ColorValueFixed
public value class ColorValueFixed
JScript supporta l'utilizzo di strutture ma non la dichiarazione di nuove.
Esempi
Nell'esempio di codice riportato di seguito viene illustrato come utilizzare una struttura ColorValueFixed.
' This code example is taken from the
' Managed Direct3D Mobile Fixed-Point Lighting Sample
' of the .NET Compact Framework Samples in the SDK.
' Set light #0 to be a simple, faint grey directional light so
' the walls and floor are slightly different shades of grey
device.LightsFixed(0).Type = LightType.Directional
device.LightsFixed(0).Direction = New Vector3Fixed(0.3F, -0.5F, 0.2F)
device.LightsFixed(0).Update()
' Set light #1 to be a simple, bright directional light to use
' on the mesh representing light #2
device.LightsFixed(1).Type = LightType.Directional
device.LightsFixed(1).Direction = New Vector3Fixed(0.5F, -0.5F, 0.5F)
device.LightsFixed(1).DiffuseColor = ColorValueFixed.FromColor(System.Drawing.Color.Blue)
device.LightsFixed(1).Update()
' Light #2 will be the light used to light the floor and
' walls. It will be set up in FrameMove() since it changes
' every frame.
// This code example is taken from the
// Managed Direct3D Mobile Fixed-Point Lighting Sample
// in the .NET Compact Framework Samples in the SDK.
// Set light #0 to be a simple, faint grey directional light so
// the walls and floor are slightly different shades of grey
device.LightsFixed[0].Type = LightType.Directional;
device.LightsFixed[0].Direction = new Vector3Fixed(0.3f, -0.5f,
0.2f);
device.LightsFixed[0].DiffuseColor =
ColorValueFixed.FromColor(System.Drawing.Color.FromArgb(64,
64, 64));
device.LightsFixed[0].Update();
// Set light #1 to be a simple, bright directional light to use
// on the mesh representing light #2
device.LightsFixed[1].Type = LightType.Directional;
device.LightsFixed[1].Direction =
new Vector3Fixed(0.5f, -0.5f, 0.5f);
device.LightsFixed[1].DiffuseColor =
ColorValueFixed.FromColor((System.Drawing.Color.Blue));
device.LightsFixed[1].Update();
// Light #2 will be the light used to light the floor and
// walls. It will be set up in FrameMove() since it changes
// every frame.
Codice thread safe
Qualsiasi membro static (Shared in Visual Basic) pubblico di questo tipo è thread-safe. I membri di istanza non sono garantiti come thread-safe.
Piattaforme
Windows CE, Windows Mobile per Smartphone, Windows Mobile per Pocket PC
.NET Framework e .NET Compact Framework non supportano tutte le versioni di ciascuna piattaforma. Per un elenco delle versioni supportate, vedere Requisiti di sistema di .NET Framework.
Informazioni sulla versione
.NET Compact Framework
Supportato in: 3.5, 2.0
Vedere anche
Riferimenti
Spazio dei nomi Microsoft.WindowsMobile.DirectX.Direct3D
Altre risorse
Programmazione per Mobile Direct3D in .NET Compact Framework