Compartir a través de


ColorValueFixed Structure

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

Stores the red, green, blue, and alpha channel values, in a fixed-point structure, that together define a specific color.

Namespace:  Microsoft.WindowsMobile.DirectX.Direct3D
Assembly:  Microsoft.WindowsMobile.DirectX (in Microsoft.WindowsMobile.DirectX.dll)

Syntax

'Declaration
Public Structure ColorValueFixed
'Usage
Dim instance As ColorValueFixed
public struct ColorValueFixed
public value class ColorValueFixed
[<SealedAttribute>]
type ColorValueFixed =  struct end

Examples

The following code example shows how to use a ColorValueFixed structure.

' 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.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Windows CE, Windows Mobile for Smartphone, Windows Mobile for Pocket PC

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Version Information

.NET Compact Framework

Supported in: 3.5, 2.0

See Also

Reference

ColorValueFixed Members

Microsoft.WindowsMobile.DirectX.Direct3D Namespace

Other Resources

Mobile Direct3D Programming in the .NET Compact Framework