Class TextureCanvasExtensions
Provides extension methods for creating instances of TextureCanvas.
public static class TextureCanvasExtensions
- Inheritance
-
TextureCanvasExtensions
Methods
CreateTextureCanvas(IServiceRegistry, Size2?, PixelFormat)
Creates a new instance of TextureCanvas using the specified IServiceRegistry.
public static TextureCanvas CreateTextureCanvas(this IServiceRegistry services, Size2? size, PixelFormat pixelFormat = PixelFormat.R8G8B8A8_UNorm)
Parameters
servicesIServiceRegistryThe service registry to use for creating the texture canvas.
sizeSize2?The size of the texture canvas. If null, a default size will be used.
pixelFormatPixelFormatThe pixel format of the texture canvas. Default is Stride.Graphics.PixelFormat.R8G8B8A8_UNorm.
Returns
- TextureCanvas
A new instance of TextureCanvas.
CreateTextureCanvas(IGame, Size2?, PixelFormat)
Creates a new instance of TextureCanvas using the specified IGame.
public static TextureCanvas CreateTextureCanvas(this IGame game, Size2? size, PixelFormat pixelFormat = PixelFormat.R8G8B8A8_UNorm)
Parameters
gameIGameThe game instance to use for creating the texture canvas.
sizeSize2?The size of the texture canvas. If null, a default size will be used.
pixelFormatPixelFormatThe pixel format of the texture canvas. Default is Stride.Graphics.PixelFormat.R8G8B8A8_UNorm.
Returns
- TextureCanvas
A new instance of TextureCanvas.
CreateTextureCanvas(RenderContext, Size2?, PixelFormat)
Creates a new instance of TextureCanvas using the specified RenderContext.
public static TextureCanvas CreateTextureCanvas(this RenderContext renderContext, Size2? size, PixelFormat pixelFormat = PixelFormat.R8G8B8A8_UNorm)
Parameters
renderContextRenderContextThe render context to use for creating the texture canvas.
sizeSize2?The size of the texture canvas. If null, a default size will be used.
pixelFormatPixelFormatThe pixel format of the texture canvas. Default is Stride.Graphics.PixelFormat.R8G8B8A8_UNorm.
Returns
- TextureCanvas
A new instance of TextureCanvas.