CanvasImageSource Class |
Namespace: Microsoft.Graphics.Canvas.UI.Xaml
public sealed class CanvasImageSource : SurfaceImageSource, ICanvasResourceCreatorWithDpi, ICanvasResourceCreator
The CanvasImageSource type exposes the following members.
Name | Description | |
---|---|---|
CanvasImageSource(ICanvasResourceCreatorWithDpi, Size) | Initializes a new instance of the CanvasImageSource class. | |
CanvasImageSource(ICanvasResourceCreatorWithDpi, Single, Single) | Initializes a new instance of the CanvasImageSource class. | |
CanvasImageSource(ICanvasResourceCreator, Single, Single, Single) | Initializes a new instance of the CanvasImageSource class. | |
CanvasImageSource(ICanvasResourceCreator, Single, Single, Single, CanvasAlphaMode) | Initializes a new instance of the CanvasImageSource class. |
Name | Description | |
---|---|---|
AlphaMode | Returns the alpha mode for this image source that was passed in
to the constructor. | |
Device | Gets the device used by this image source. | |
Dpi | Gets the dots-per-inch (DPI) of this image source. | |
Size | Gets the size of the image source, in device independent pixels (DIPs). | |
SizeInPixels | Gets the size of the image source, in pixels. |
Name | Description | |
---|---|---|
ConvertDipsToPixels | Converts units from device independent pixels (DIPs) to physical pixels based on the DPI of this image source. | |
ConvertPixelsToDips | Converts units from physical pixels to device independent pixels (DIPs) based on the DPI of this image source. | |
CreateDrawingSession(Color) | Returns a new drawing session for redrawing the entire image source. | |
CreateDrawingSession(Color, Rect) | Returns a new drawing session for updating a region of the image source. | |
Recreate | Recreates the underlying image source. |
var imageSource = new CanvasImageSource(canvasDevice, width, height, dpi); imageControl.Source = imageSource; using (var ds = imageSource.CreateDrawingSession(Colors.Black)) { // drawing code }