Html5CanvasOptions Class
Contents
[
Hide
]Summary: 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.
Module: aspose.imaging.imageoptions
Full Name: aspose.imaging.imageoptions.Html5CanvasOptions
Inheritance: IHasXmpData, IHasMetadata, ImageOptionsBase
Constructors
Name | Description |
---|---|
Html5CanvasOptions() | Initializes a new instance of the Html5CanvasOptions class. |
Properties
Name | Type | Access | Description |
---|---|---|---|
buffer_size_hint | int | r/w | Gets or sets the buffer size hint which is defined max allowed size for all internal buffers. |
canvas_tag_id | string | r/w | Gets or sets the canvas tag identifier. |
disposed | bool | r | Gets a value indicating whether this instance is disposed. |
encoding | string | r/w | Gets or sets the encoding. |
full_frame | bool | r/w | Gets or sets a value indicating whether [full frame]. |
full_html_page | bool | r/w | Gets or sets a value indicating whether the full HTML page should be generated. |
keep_metadata | bool | r/w | Gets a value whether to keep original image metadata on export. |
multi_page_options | MultiPageOptions | r/w | The multipage options |
palette | IColorPalette | r/w | Gets or sets the color palette. |
resolution_settings | ResolutionSetting | r/w | Gets or sets the resolution settings. |
source | Source | r/w | Gets or sets the source to create image in. |
vector_rasterization_options | VectorRasterizationOptions | r/w | Gets or sets the vector rasterization options. |
xmp_data | XmpPacketWrapper | r/w | Gets or sets the XMP metadata container. |
Methods
Name | Description |
---|---|
clone() | Creates a memberwise clone of this instance. |
Constructor: Html5CanvasOptions()
Html5CanvasOptions()
Initializes a new instance of the Html5CanvasOptions class.
Method: clone()
clone()
Creates a memberwise clone of this instance.
Returns
Type | Description |
---|---|
ImageOptionsBase | A memberwise clone of this 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.
from aspose.imaging import Image
from aspose.imaging.imageoptions import Html5CanvasOptions, SvgRasterizationOptions
with Image.load("Sample.svg") as image:
export_options = Html5CanvasOptions()
export_options.vector_rasterization_options = SvgRasterizationOptions()
image.save("Canvas.html", export_options)
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.
from aspose.imaging import Image
from aspose.imaging.imageoptions import Html5CanvasOptions, SvgRasterizationOptions
with Image.load("Sample.svg") as image:
options = Html5CanvasOptions()
options.vector_rasterization_options = SvgRasterizationOptions()
options.full_html_page = False
image.save("Canvas.html", options)