is there a possibility to set the DPI for the CADImage.Draw(graphics, rectangleF) method. I'd like to export a given CADImage to an in memory BMP and use it for a custom printing system. At the moment i just can print in low / screen resolution.
My Code:
Code: Select all
RectangleF imageRect = cadEditorControl1.ImageRectangleF;
Bitmap bmp = new Bitmap(cadEditorControl1.PictureBox.Size.Width, cadEditorControl1.Size.Height);
Graphics g = Graphics.FromImage(bmp);
g.InterpolationMode = InterpolationMode.HighQualityBicubic;
g.SmoothingMode = SmoothingMode.HighQuality;
g.PixelOffsetMode = PixelOffsetMode.HighQuality;
g.CompositingQuality = CompositingQuality.HighQuality;
g.TextRenderingHint = TextRenderingHint.AntiAliasGridFit;
cadEditorControl.Image.Draw(g, imageRect);
//=> my printing system:
CadPrinter p = new CadPrinter(bmp);
bmp.SetResolution(dpi, dpi);
doesn't work because the image DPI are changed, but the real size also changes. I can fix this by changing the bmp image, but the CADIMAGE seems to be drawn in ~96DPI.
Thank you for your help,
Roman