HPGL to BMP
Moderators: SDS, support, admin
HPGL to BMP
Hi,
I'm trying to convert an HPGL image to bitmap using your demo library.
However, the result is just a blank image 146x201 pixels. Why? The HPGL source file is attached.
Addionally, how can I specify the resolution when saving a bitmap (e.g. 150 DPI)?
I'm trying to convert an HPGL image to bitmap using your demo library.
Code: Select all
using CADImport.HPGL2;
using System.Drawing.Imaging;
//...
HPGLImage img = new HPGLImage();
img.LoadFromFile(@"C:\00006.hpgl");
img.SaveToFile(@"C:\00006.bmp", ImageFormat.Bmp, img.Extents, PixelFormat.Format24bppRgb);
Addionally, how can I specify the resolution when saving a bitmap (e.g. 150 DPI)?
- Attachments
-
- 00006.zip
- (71.74 KiB) Downloaded 1268 times
Re: HPGL to BMP
Hello,
It seems that the problem is caused by using img.Extents in the SaveToFile method. Please try the following code, it produces a larger bitmap file:
As for setting the resolution (DPI) for the output bitmap file, I'll explain it in a separate topic. Stay tuned!
Mikhail
It seems that the problem is caused by using img.Extents in the SaveToFile method. Please try the following code, it produces a larger bitmap file:
Code: Select all
using CADImport;
using CADImport.HPGL2;
using System.Drawing.Imaging;
...
CADImage img = HPGLImage.CreateImageByExtension(@"C:\00006.hpgl");
img.LoadFromFile(@"C:\00006.hpgl");
DRect imageSize = new DRect(0, 0, img.AbsWidth * 5, img.AbsHeight * 5);
img.SaveToFile(@"C:\00006.bmp", ImageFormat.Bmp, imageSize, PixelFormat.Format24bppRgb);
Mikhail
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support
Chat support on Skype: cadsofttools.support
Re: HPGL to BMP
Please take a look at How to specify a DPI when saving to a BMP file topic.Addionally, how can I specify the resolution when saving a bitmap (e.g. 150 DPI)?
Mikhail
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support
Chat support on Skype: cadsofttools.support