Click or drag to resize
CanvasSpriteOptions Enumeration
[Win10_10586] Options that apply to the entire spritebatch.

Namespace:  Microsoft.Graphics.Canvas
Assembly:  Microsoft.Graphics.Canvas (in Microsoft.Graphics.Canvas.dll) Version: 0.0.0.0
Syntax
C#
[FlagsAttribute]
public enum CanvasSpriteOptions
Members
  Member nameValueDescription
None0[Win10_10586] The default, no special options are provided.
ClampToSourceRect1[Win10_10586] Ensures that no pixels outside of the source rectangle get drawn.
Remarks

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.

See Also