Represents a renderable image.
Constructors
public CanvasImage(string filename)
Initializes a new instance of the CanvasImage class.
Parameters:
filename (string)The image filename.
public CanvasImage(ReadOnlySpan<byte> data)
Initializes a new instance of the CanvasImage class.
Parameters:
data (ReadOnlySpan<byte>)Buffer containing an image.
public CanvasImage(Stream data)
Initializes a new instance of the CanvasImage class.
Parameters:
data (Stream)Stream containing an image.
Properties
Height
: intGets the image height.
MaxWidth
: int?Gets or sets the render width of the canvas.
PixelWidth
: intGets or sets the render width of the canvas.
Width
: intGets the image width.
Extension Methods
CanvasImage MaxWidth(this CanvasImage image, int? maxWidth)Sets the maximum width of the rendered image.
Returns:
The same instance so that multiple calls can be chained.
CanvasImage NoMaxWidth(this CanvasImage image)Disables the maximum width of the rendered image.
Returns:
The same instance so that multiple calls can be chained.
CanvasImage PixelWidth(this CanvasImage image, int width)Sets the pixel width.
Returns:
The same instance so that multiple calls can be chained.