The easy way to create an image from the drawing file is to use the “CapturePreviewImage” API of document. As this is an API of document, you need to open the drawing file in the editor to use this API.
[CommandMethod("CreateImage")]
static public void CreateImage()
{
//zoom extents... need to use .NET 4.0
dynamic acad = Application.AcadApplication;
acad.ZoomExtents();
Document doc = Application.DocumentManager.MdiActiveDocument;
using (Bitmap image = doc.CapturePreviewImage(376, 292))
{
//save the image...
image.Save("c:\\temp\\test.png",
System.Drawing.Imaging.ImageFormat.Png);
}
}