Share via


Texture (Clase)

Actualización: noviembre 2007

Manipula un recurso de textura.

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

Sintaxis

'Declaración
Public Class Texture _
    Inherits BaseTexture _
    Implements IDisposable
'Uso
Dim instance As Texture
public class Texture : BaseTexture, IDisposable
public ref class Texture : public BaseTexture, 
    IDisposable
public class Texture extends BaseTexture implements IDisposable

Comentarios

Este objeto hereda su funcionalidad de BaseTexture.

Ejemplos

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

' 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.
Friend Sub OnResetDevice(ByVal sender As Object, ByVal e As EventArgs)
    Dim dev As Device = CType(sender, Device)
    ' Turn off culling, so we 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, so we 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 our texture

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

Jerarquía de herencia

System.Object
  Microsoft.WindowsMobile.DirectX.Direct3D.Resource
    Microsoft.WindowsMobile.DirectX.Direct3D.BaseTexture
      Microsoft.WindowsMobile.DirectX.Direct3D.Texture

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

Texture (Miembros)

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

Otros recursos

Programar Mobile Direct3D en .NET Compact Framework