CanvasVirtualBitmap Class |
Namespace: Microsoft.Graphics.Canvas
public sealed class CanvasVirtualBitmap : IDisposable, ICanvasImage, IGraphicsEffectSource
The CanvasVirtualBitmap type exposes the following members.
Name | Description | |
---|---|---|
Bounds | Gets the bounds of the virtual bitmap in device independent pixels (DIPs). | |
Device | The device associated with this CanvasVirtualBitmap. | |
IsCachedOnDemand | Gets whether or not the current virtual bitmap is cached on demand. | |
Size | Gets the size of the bitmap, in device independent pixels (DIPs). | |
SizeInPixels | Gets the size of the bitmap, in pixels. |
CanvasVirtualBitmap can be used to load and draw images that are larger than the maximum size of bitmaps supported on this device. CanvasDevice.MaximumBitmapSizeInPixels can be used to determine this size. Generally, you can assume that this value is at least 4096. Any attempt to load a CanvasBitmap larger than the maximum bitmap size will fail. CanvasVirtualBitmap allows you to reliably load any sized image.
CanvasVirtualBitmaps are always treated as 96 DPI. This means that the size in pixels and the size in DIPs have the same numerical values.
CanvasVirtualBitmaps can operate in two major modes, controlled by the CanvasVirtualBitmapOptions value passed to LoadAsync. The default, CanvasVirtualBitmapOptions.None, loads the entire image in one go, making it immediately available for drawing.
The other mode, CanvasVirtualBitmapOptions.CacheOnDemand, attempts to cache (load) only the parts of the image that are required. Drawing a part of the image that hasn't previously been cached can trigger IO.
Not all images support CacheOnDemand (currently only certain jpeg images support this). The IsCachedOnDemand property can be used to determine if the image loaded is actually using cache on demand.
When using Direct2D interop, this Win2D class corresponds to one of the Direct2D interfaces ID2D1ImageSource or ID2D1TransformedImageSource.