public class Html5CanvasOptions extends ImageOptionsBase
The Html5 Canvas file format creation options.
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.
try (com.aspose.imaging.Image image = com.aspose.imaging.Image.load("Sample.svg")) { com.aspose.imaging.imageoptions.VectorRasterizationOptions vectorRasterizationOptions = new com.aspose.imaging.imageoptions.SvgRasterizationOptions(); com.aspose.imaging.imageoptions.Html5CanvasOptions options = new com.aspose.imaging.imageoptions.Html5CanvasOptions(); options.setVectorRasterizationOptions(vectorRasterizationOptions); image.save("Canvas.html", options); }
Constructor and Description |
---|
Html5CanvasOptions()
Initializes a new instance of the
Html5CanvasOptions class. |
Html5CanvasOptions(Html5CanvasOptions imageOptions)
Initializes a new instance of the
ImageOptionsBase class. |
Modifier and Type | Method and Description |
---|---|
String |
getCanvasTagId()
Gets the canvas tag identifier.
|
Charset |
getEncoding()
Gets the encoding.
|
boolean |
getFullHtmlPage()
Gets a value indicating whether the full HTML page should be generated.
|
void |
setCanvasTagId(String value)
Sets the canvas tag identifier.
|
void |
setEncoding(Charset value)
Sets the encoding.
|
void |
setFullHtmlPage(boolean value)
Sets a value indicating whether the full HTML page should be generated.
|
deepClone, getBufferSizeHint, getFullFrame, getMultiPageOptions, getPalette, getProgressEventHandler, getResolutionSettings, getSource, getVectorRasterizationOptions, getXmpData, setBufferSizeHint, setFullFrame, setMultiPageOptions, setPalette, setProgressEventHandler, setResolutionSettings, setSource, setVectorRasterizationOptions, setXmpData
close, dispose, getDisposed
public Html5CanvasOptions()
Initializes a new instance of the Html5CanvasOptions
class.
public Html5CanvasOptions(Html5CanvasOptions imageOptions)
Initializes a new instance of the ImageOptionsBase
class.
imageOptions
- The image options.public final String getCanvasTagId()
Gets the canvas tag identifier.
public final void setCanvasTagId(String value)
Sets the canvas tag identifier.
value
- the canvas tag identifier.public final boolean getFullHtmlPage()
Gets a value indicating whether the full HTML page should be generated.
public final void setFullHtmlPage(boolean value)
Sets a value indicating whether the full HTML page should be generated.
value
- a value indicating whether the full HTML page should be generated.You can embed more than one Canvas image within HTML page or update already existing page. In order to do that you need to export only the Canvas tag.
try (com.aspose.imaging.Image image = com.aspose.imaging.Image.load("Sample.svg")) { com.aspose.imaging.imageoptions.VectorRasterizationOptions vectorRasterizationOptions = new com.aspose.imaging.imageoptions.SvgRasterizationOptions(); com.aspose.imaging.imageoptions.Html5CanvasOptions options = new com.aspose.imaging.imageoptions.Html5CanvasOptions(); options.setVectorRasterizationOptions(vectorRasterizationOptions); options.setFullHtmlPage(false); image.save("Canvas.html", options); }
public final Charset getEncoding()
Gets the encoding.
public final void setEncoding(Charset value)
Sets the encoding.
value
- the encoding.