Released on July 2, 2008 (build 1456).
Main features
(F73) PNG/GIF/JPG/BMP Export (DayPilot Calendar)
![export314x251](https://aspnet.daypilot.org/page/image/d74d9b61-90b6-449e-bd99-978749202afe/export314x251.png)
A new server-side Export() method is available in DayPilot Calendar:
- It's a method of DayPilotCalendar class (i.e. no special control required).
- It supports all main bitmap image formats: PNG, GIF, JPG, BMP... (all formats supported by Bitmap.Save()).
Why?
- Print the exported image easily.
- Save the exported image to a file.
- Non-web applications:
- Show a read-only calendar in WebForm applications
- Include it in PDF files generated on the server
- Include it in generated e-mails
Usage modes:
- Special page: Place 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();
}
Bugs
Improvements