Click or drag to resize
AB4D logo

WpfMaterialLoadTexture2D(DXDevice, String, TextureInfo) Method

LoadTexture2D loads a 2D Texture from the specified fileName and returns a ShaderResourceView for the texture. User must dispose the returned ShaderResourceView when it is not used any more to prevent memory leak. This method uses WPF's image loader - to load the image directly into DirectX use the LoadShaderResourceView(Device, String, TextureInfo) or LoadShaderResourceView(Device, String, Boolean, Boolean, Boolean, TextureInfo) methods instead.

Namespace: Ab3d.DirectX.Materials
Assembly: Ab3d.DXEngine.Wpf (in Ab3d.DXEngine.Wpf.dll) Version: 7.0.8865.1045
Syntax
C#
public static ShaderResourceView LoadTexture2D(
	DXDevice dxDevice,
	string fileName,
	out TextureInfo textureInfo
)

Parameters

dxDevice  DXDevice
DXDevice used to create the texture
fileName  String
file name of the texture
textureInfo  TextureInfo
TextureInfo class that provides information about the loaded bitmap

Return Value

ShaderResourceView
ShaderResourceView for the loaded 2D Texture or null if the texture cannot be created.
See Also