AngleSharp by AngleSharp

<PackageReference Include="AngleSharp" Version="1.0.1-alpha-241" />

.NET API 884,736 bytes

 HtmlCanvasElement

Represents the HTML canvas element. See: http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html Alternative: http://www.w3.org/html/wg/drafts/html/master/embedded-content-0.html#the-canvas-element
public int Height { get; set; }

Gets or sets the displayed height of the canvas element.

public int Width { get; set; }

Gets or sets the displayed width of the canvas element.

public HtmlCanvasElement(Document owner, string prefix = null)

Creates a new HTML canvas element.

public IRenderingContext GetContext(string contextId)

Gets the drawing context.

public bool IsSupportingContext(string contextId)

Gets an indicator if a context with the given parameters could be created.

public void SetContext(IRenderingContext context)

Changes the context the element is related to the given one.

public void ToBlob(Action<Stream> callback, string type = null)

Creates a BLOB out of the canvas pixel data and passes it to the given callback.

public string ToDataUrl(string type = null)

Returns a Data URI with the bitmap data of the context.