Condividi tramite


Classe TextureLoader

Aggiornamento: novembre 2007

Contiene funzioni per il caricamento delle trame.

Spazio dei nomi:  Microsoft.WindowsMobile.DirectX.Direct3D
Assembly:  Microsoft.WindowsMobile.DirectX (in Microsoft.WindowsMobile.DirectX.dll)

Sintassi

'Dichiarazione
Public NotInheritable Class TextureLoader
'Utilizzo
Dim instance As TextureLoader
public sealed class TextureLoader
public ref class TextureLoader sealed
public final class TextureLoader

Esempi

Nell'esempio di codice riportato di seguito viene illustrato come caricare una trama.

' 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"));
}

Gerarchia di ereditarietà

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

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

Membri TextureLoader

Spazio dei nomi Microsoft.WindowsMobile.DirectX.Direct3D

Altre risorse

Programmazione per Mobile Direct3D in .NET Compact Framework