Share via


TextureLoader (Clase)

Actualización: noviembre 2007

Contiene funciones para cargar texturas.

Espacio de nombres:  Microsoft.WindowsMobile.DirectX.Direct3D
Ensamblado:  Microsoft.WindowsMobile.DirectX (en Microsoft.WindowsMobile.DirectX.dll)

Sintaxis

'Declaración
Public NotInheritable Class TextureLoader
'Uso
Dim instance As TextureLoader
public sealed class TextureLoader
public ref class TextureLoader sealed
public final class TextureLoader

Ejemplos

En el ejemplo de código siguiente se muestra cómo cargar una textura.

' This code example is taken from the
' Direct3D Mobile Texture Sample of the
' .NET Compact Framework samples.

' Called whenever the rendering device is reset.
Private Sub OnResetDevice(ByVal sender As Object, ByVal e As EventArgs) 
    Dim dev As Device = CType(sender, Device)
    ' Turn off culling, to see the front and back of the triangle.
    dev.RenderState.CullMode = Cull.None
    ' Turn off D3D lighting.
    dev.RenderState.Lighting = False
    ' Turn on the ZBuffer.
    dev.RenderState.ZBufferEnable = True
    ' Turn on perspective correction for textures
    ' This provides a more accurate visual at the cost
    ' of a small performance overhead.
    dev.RenderState.TexturePerspective = True
    ' Now create the texture.
    texture = TextureLoader.FromStream(dev, _
    [Assembly].GetExecutingAssembly().GetManifestResourceStream("Texture.Content.Banana.bmp"))

End Sub

// This code example is taken from the
// Direct3D Mobile Texture Sample included with the
// .NET Compact Framework samples.

// Called whenever the rendering device is reset.
void OnResetDevice(object sender, EventArgs e)
{
    Device dev = (Device)sender;
    // Turn off culling, to see the front and back of the triangle.
    dev.RenderState.CullMode = Cull.None;
    // Turn off D3D lighting.
    dev.RenderState.Lighting = false;
    // Turn on the ZBuffer.
    dev.RenderState.ZBufferEnable = true;
    // Turn on perspective correction for textures.
    // This provides a more accurate visual at the cost
    // of a small performance overhead.
    dev.RenderState.TexturePerspective = true;

    // Now create the texture.
    texture = TextureLoader.FromStream(dev,
        Assembly.GetExecutingAssembly().GetManifestResourceStream(
        "Texture.Content.Banana.bmp"));
}

Jerarquía de herencia

System.Object
  Microsoft.WindowsMobile.DirectX.Direct3D.TextureLoader

Seguridad para subprocesos

Todos los miembros static (Shared en Visual Basic) públicos de este tipo son seguros para la ejecución de subprocesos. No se garantiza que los miembros de instancias sean seguros para la ejecución de subprocesos.

Plataformas

Windows CE, Windows Mobile para Smartphone, Windows Mobile para Pocket PC

.NET Framework y .NET Compact Framework no admiten todas las versiones de cada plataforma. Para obtener una lista de las versiones compatibles, vea Requisitos de sistema de .NET Framework.

Información de versión

.NET Compact Framework

Compatible con: 3.5, 2.0

Vea también

Referencia

TextureLoader (Miembros)

Microsoft.WindowsMobile.DirectX.Direct3D (Espacio de nombres)

Otros recursos

Programar Mobile Direct3D en .NET Compact Framework