Calendar: Image Export (BMP, PNG, GIF, JPG)

It is possible to export the Calendar into several image formats:
Applications
- Print the exported image reliably.
- Save the exported image to a file.
- Non-web applications:
- Show a read-only calendar in WebForm applications
- Include a Calendar snapshot in PDF files generated on the server
- Include a Calendar snapshot in generated e-mails
Usage Modes
- Special page: Put DayPilotCalendar (with the same configuration as on the dynamic page) on a special page and overwrite the Response stream in all cases.
- PostBack: Use a button on an existing page and overwrite the Response stream in the button Click event handler (returns the image after clicking a button).
- Desktop/server/console applications: Create the control dynamically and export the image from any other kind of application.
Signatures
public MemoryStream Export(ImageFormat format);
public MemoryStream Export(ImageFormat format, int scrollPosition);
Example
protected void ButtonExport_Click(object sender, EventArgs e)
{
int hourHeight = DayPilotCalendar1.CellsPerHour*DayPilotCalendar1.CellHeight;
Response.Clear();
Response.ContentType = "image/png";
MemoryStream img = DayPilotCalendar1.Export(ImageFormat.Png, 9 * hourHeight);
img.WriteTo(Response.OutputStream);
Response.End();
}See Also
Available Since