CanvasSpriteOptions Enumeration |
Namespace: Microsoft.Graphics.Canvas
[FlagsAttribute] public enum CanvasSpriteOptions
Member name | Value | Description | |
---|---|---|---|
None | 0 | [Win10_10586] The default, no special options are provided. | |
ClampToSourceRect | 1 | [Win10_10586] Ensures that no pixels outside of the source rectangle get drawn. |
This API is only available when running on Windows 10 build 10586 (released November 2015) or greater.
CreateSpriteBatch(CanvasSpriteSortMode, CanvasImageInterpolation, CanvasSpriteOptions) accepts an options parameter.
When drawing from a sprite sheet the GPU can sometimes sample from outside the source rectangle. Sprite sheets often need to have padding added between sprites to avoid this issue. When it is not possible or desirable to add this padding, the CanvasSpriteOptions.ClampToSourceRect option can be used instead. It adds a small performance cost to rendering, but ensures that nothing outside the source rect is drawn.