Skip to main content Skip to footer

Export and Save C1Maps as an Image in WinForms

Background:

C1Maps for WinForms does not expose a method to print/save it as an image. In other words, a user cannot export the maps view using the control’s API. This is a limitation of C1Maps.

Therefore, this article shows how to workaround the above limitation and save/export C1Maps as an image.

Steps to Complete:

To be able to save C1Maps as an image, the DrawToBitmap method can be used, as follows:

using (Bitmap bmp = new Bitmap(c1Map1.Width, c1Map1.Height))
{
      this.DrawToBitmap(bmp, new Rectangle(c1Map1.Location, bmp.Size));
      bmp.Save("../../Exported_C1Maps.png", ImageFormat.Png);
}

Tags:

Ruchir Agarwal