Saves the canvas image as a file.
Syntax

[C#]

void SaveAs(string inFile);
void SaveAs(string inFile, XExport inExport);

[Visual Basic]

Sub SaveAs(inFile As String)
Sub SaveAs(inFile As String, inExport As XExport)
Params
Name Description
inFile The file to be saved (including file extension).
inExport The export options.
Notes

Use this method to export the Canvas to file. When no export options are specified, the Export property is used. For this reason you should not normally need to specify an export parameter.

See Also

GetAs

Example

[C#]Canvas canvas = new Canvas(Server.MapPath("rez/boat.gif"));
canvas.SaveAs(Server.MapPath("myfile1.jpg"));
canvas.Export.Quality = 100;
canvas.SaveAs(Server.MapPath("myfile2.jpg"));
canvas.Export.Interlace = true;
canvas.SaveAs(Server.MapPath("myfile3.gif"));
canvas.Export.Interlace = false;
canvas.Export.TransparentPoint = new XPoint(10, 10);
canvas.SaveAs(Server.MapPath("myfile4.gif"));


[Visual Basic]Dim canvas As New Canvas(Server.MapPath("rez/boat.gif"))
canvas.SaveAs(Server.MapPath("myfile1.jpg"))
canvas.Export.Quality = 100
canvas.SaveAs(Server.MapPath("myfile2.jpg"))
canvas.Export.Interlace = True
canvas.SaveAs(Server.MapPath("myfile3.gif"))
canvas.Export.Interlace = False
canvas.Export.TransparentPoint = New XPoint(10, 10)
canvas.SaveAs(Server.MapPath("myfile4.gif"))


This code produces four files as output. The first two files are jpeg images. The second is saved in high quality.

The second two files are gif images. The first is interlaced and the second is transparent (using the color at the point 10,10 as the transparent color).