TextureLoader-Klasse
Dieser Dokumentation für die Vorschau nur ist und in späteren Versionen geändert. Leere Themen wurden als Platzhalter eingefügt.]
Enthält Funktionen zum Laden von Texturen.
Namespace: Microsoft.WindowsMobile.DirectX.Direct3D
Assembly: Microsoft.WindowsMobile.DirectX (in Microsoft.WindowsMobile.DirectX.dll)
Syntax
'Declaration
Public NotInheritable Class TextureLoader
'Usage
Dim instance As TextureLoader
public sealed class TextureLoader
public ref class TextureLoader sealed
[<SealedAttribute>]
type TextureLoader = class end
Beispiele
Im folgenden Codebeispiel wird das Laden einer Textur veranschaulicht.
' This code example is taken from the' Direct3D Mobile Texture Sample of the' .NET Compact Framework samples.
' Called whenever the rendering device is reset.PrivateSub OnResetDevice(ByVal sender AsObject, 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"))
EndSub
// 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"));
}
Vererbungshierarchie
System.Object
Microsoft.WindowsMobile.DirectX.Direct3D.TextureLoader
Threadsicherheit
Alle öffentlichen static (Shared in Visual Basic)-Member dieses Typs sind threadsicher. Bei Instanzmembern ist die Threadsicherheit nicht gewährleistet.
Plattformen
Windows CE, Windows Mobile für Smartphone, Windows Mobile für Pocket PC
Die .NET Framework und .NET Compact Framework unterstützen nicht alle Versionen sämtlicher Plattformen. Eine Liste der unterstützten Versionen finden Sie unter Systemanforderungen für .NET framework.
Versionsinformationen
.NET Compact Framework
Unterstützt in: 3.5, 2.0
Siehe auch
Referenz
Microsoft.WindowsMobile.DirectX.Direct3D-Namespace