Html5CanvasOptions

Html5CanvasOptions class

Create HTML5 Canvas files effortlessly with our API, allowing you to seamlessly combine elements like forms, text, images, animations, and links. Benefit from robust features including tag identifier and encoding settings support, ensuring optimal performance and customization for your web projects.

public class Html5CanvasOptions : ImageOptionsBase

Constructors

NameDescription
Html5CanvasOptions()The default constructor.

Properties

NameDescription
BufferSizeHint { get; set; }Gets or sets the buffer size hint which is defined max allowed size for all internal buffers.
CanvasTagId { get; set; }Gets or sets the canvas tag identifier.
Disposed { get; }Gets a value indicating whether this instance is disposed.
Encoding { get; set; }Gets or sets the encoding.
FullFrame { get; set; }Gets or sets a value indicating whether [full frame].
FullHtmlPage { get; set; }Gets or sets a value indicating whether the full HTML page should be generated.
MultiPageOptions { get; set; }The multipage options
virtual Palette { get; set; }Gets or sets the color palette.
ProgressEventHandler { get; set; }Gets or sets the progress event handler.
virtual ResolutionSettings { get; set; }Gets or sets the resolution settings.
Source { get; set; }Gets or sets the source to create image in.
VectorRasterizationOptions { get; set; }Gets or sets the vector rasterization options.
virtual XmpData { get; set; }Gets or sets the XMP metadata container.

Methods

NameDescription
virtual Clone()Clones this instance.
Dispose()Disposes the current instance.

Examples

Any vector image (SVG, WMF, CMX, etc.) can be used as a source for your Canvas images. The following code creates a simple Canvas image.

[C#]

using (var image = Image.Load(@"Sample.svg"))
{
    image.Save(@"Canvas.html", new Html5CanvasOptions
    {
        VectorRasterizationOptions = new SvgRasterizationOptions()
    });
}

You can embed more than one Canvas image within HTML page or update already exsiting page. In order to do that you need to export only the Canvas tag.

[C#]

using (var image = Image.Load(@"Sample.svg"))
{
    image.Save(@"Canvas.html", new Html5CanvasOptions
    {
        VectorRasterizationOptions = new SvgRasterizationOptions(),
        FullHtmlPage = false
    });
}

See Also