How to convert an hpgl to a bmp from a WPF application
Moderators: SDS, support, admin
How to convert an hpgl to a bmp from a WPF application
Hello,
I have a WPF application that reads a DXF, converts it to a bitmap and then warps the image shape to fit on a work surface. This is used with a projector and the user input is a barcode that indicates the file name. I have a customer who wants me to support HPGL.
What is the easiest way to convert an HPGL file into a BMP file with CADImport7 Pro? I do not want to visualize the HPGL. I will load the BMP into the WPF interface after conversion.
Best regards.
I have a WPF application that reads a DXF, converts it to a bitmap and then warps the image shape to fit on a work surface. This is used with a projector and the user input is a barcode that indicates the file name. I have a customer who wants me to support HPGL.
What is the easiest way to convert an HPGL file into a BMP file with CADImport7 Pro? I do not want to visualize the HPGL. I will load the BMP into the WPF interface after conversion.
Best regards.
Re: How to convert an hpgl to a bmp from a WPF application
Hi,
I used the following method:
Dim cadImageFld As CADImage
Dim tmp As String = System.IO.Path.Combine(tmpDir, Now.Ticks & ".bmp")
cadImageFld = CADImage.CreateImageByExtension(imageFName)
cadImageFld.LoadFromFile(imageFName)
If (Not cadImageFld Is Nothing) Then
Dim tmpRect As New DRect(0, 0, 1280, 768)
Dim imgFrm As ImageFormat = ImageFormat.Bmp
cadImageFld.LineWeightScale = 0.0
cadImageFld.SaveToFile(tmp, imgFrm, tmpRect)
End If
Do you recommend any changes?
Best regards.
I used the following method:
Dim cadImageFld As CADImage
Dim tmp As String = System.IO.Path.Combine(tmpDir, Now.Ticks & ".bmp")
cadImageFld = CADImage.CreateImageByExtension(imageFName)
cadImageFld.LoadFromFile(imageFName)
If (Not cadImageFld Is Nothing) Then
Dim tmpRect As New DRect(0, 0, 1280, 768)
Dim imgFrm As ImageFormat = ImageFormat.Bmp
cadImageFld.LineWeightScale = 0.0
cadImageFld.SaveToFile(tmp, imgFrm, tmpRect)
End If
Do you recommend any changes?
Best regards.
Re: How to convert an hpgl to a bmp from a WPF application
Hello.
I can make only one remark. You can use CADImage.SaveToStream method instead the CADImage.SaveToFile and load from stream into your application without file creation.
Alexander.
I can make only one remark. You can use CADImage.SaveToStream method instead the CADImage.SaveToFile and load from stream into your application without file creation.
Alexander.
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support
Chat support on Skype: cadsofttools.support