Classe Texture
Aggiornamento: novembre 2007
Modifica una risorsa di trama.
Spazio dei nomi: Microsoft.WindowsMobile.DirectX.Direct3D
Assembly: Microsoft.WindowsMobile.DirectX (in Microsoft.WindowsMobile.DirectX.dll)
Sintassi
'Dichiarazione
Public Class Texture _
Inherits BaseTexture _
Implements IDisposable
'Utilizzo
Dim instance As Texture
public class Texture : BaseTexture, IDisposable
public ref class Texture : public BaseTexture,
IDisposable
public class Texture extends BaseTexture implements IDisposable
Note
Questo oggetto eredita la funzionalità dall'oggetto BaseTexture.
Esempi
Nell'esempio di codice riportato di seguito viene illustrato come utilizzare una trama.
' 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"));
}
Gerarchia di ereditarietà
System.Object
Microsoft.WindowsMobile.DirectX.Direct3D.Resource
Microsoft.WindowsMobile.DirectX.Direct3D.BaseTexture
Microsoft.WindowsMobile.DirectX.Direct3D.Texture
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
Spazio dei nomi Microsoft.WindowsMobile.DirectX.Direct3D
Altre risorse
Programmazione per Mobile Direct3D in .NET Compact Framework