DemoDelphi DXF Export

Discuss and ask questions about CAD DLL (CAD Image DLL, CAD Importer DLL).

Moderators: SDS, support, admin

Post Reply
alran
Posts: 5
Joined: 14 Nov 2006, 17:01

DemoDelphi DXF Export

Post by alran » 14 Nov 2006, 17:12

Hi,

IÒ‘m testing your CadImage.dll Demo program that iÒ‘ve downloaded from your website (http://www.cadsofttools.com/download/cadimage.zip). Im developing in Delphi so iÒ‘ve picked the DemoDelphi projekt. Loading DXF-files works fine. How can I modify it, so I can save the DXF as Bitmap, JPEG and/or GIF like in the other Demos?

alran
Posts: 5
Joined: 14 Nov 2006, 17:01

Post by alran » 14 Nov 2006, 18:03

I have alrady created a SaveDialogClick Procedure, which opens the SaveAs Dialog. But their is always an exception of the class EUnsupFileFormat (Unsupported file format) when i want to save as.

support
Posts: 3254
Joined: 30 Mar 2005, 11:36
Contact:

Post by support » 14 Nov 2006, 18:23

Hi Alran,

We will have made respective changes to the demo soon. Until that we would like you to pay attention on the other product: <b>CADImportVCL</b>. It is available on: http://www.cadsofttools.com/download/cadimportvcl.zip This library is much more powerful and convenient in usage.

Generally saying it is necessary to use the following functions:

Code: Select all

BOOL SaveCADtoBitmap(
  <font color="blue">HANDLE</font id="blue"> <b>hObject</b>,
  <font color="blue">LPCADDRAW</font id="blue"> <b>lpcd</b>,
  <font color="blue">LPCSTR</font id="blue"> <b>lpFileName</b>
);

BOOL SaveCADtoJpeg(
  <font color="blue">HANDLE</font id="blue"> <b>hObject</b>,
  <font color="blue">LPCADDRAW</font id="blue"> <b>lpcd</b>,
  <font color="blue">LPCSTR</font id="blue"> <b>lpFileName</b>
);

BOOL SaveCADtoGif(
  <font color="blue">HANDLE</font id="blue"> <b>hObject</b>,
  <font color="blue">LPCADDRAW</font id="blue"> <b>lpcd</b>,
  <font color="blue">LPCSTR</font id="blue"> <b>lpFileName</b>

);

<b>Parameters</b>
<i>hObject</i>
  Identifies a CAD drawing object handle.
<i>lpcd</i>
  Points to CADDRAW structure containing the device context, logical coordinates, drawing format etc. 
<i>lpFileName</i>
  Points to a null-terminated string that specifies a file name with the respective extension (BMP, TIFF or JPEG)to which currently displayed layout will be saved.
Sergey.

please post questions to the forum or write to support@cadsofttools.com

alran
Posts: 5
Joined: 14 Nov 2006, 17:01

Post by alran » 14 Nov 2006, 19:07

THX for the qick answer! I will try my luck. I'm not very experienced in Delphi, but I need this for work. And when my chef says it works fine we possibly buy a licence.

And it has to be the Delphi-DLL Version. Please give me a Sign when you have implemented the Function into the DemoDelphi!

support
Posts: 3254
Joined: 30 Mar 2005, 11:36
Contact:

Post by support » 14 Nov 2006, 19:22

Tomorrow.

Sergey.

please post questions to the forum or write to support@cadsofttools.com

alran
Posts: 5
Joined: 14 Nov 2006, 17:01

Post by alran » 15 Nov 2006, 14:47

I think I have found the 3 required functions of the dll in the VBDemo:

Private Declare Function WriteFile Lib "kernel32" (ByVal hFile As Long, lpBuffer As Any, ByVal nNumberOfBytesToWrite As Long, lpNumberOfBytesWritten As Long, ByVal lpOverlapped As Any) As Long

Private Declare Function CreateFile Lib "kernel32" Alias "CreateFileA" (ByVal lpFileName As String, ByVal dwDesiredAccess As Long, ByVal dwShareMode As Long, ByVal lpSecurityAttributes As Any, ByVal dwCreationDisposition As Long, ByVal dwFlagsAndAttributes As Long, ByVal hTemplateFile As Long) As Long

Private Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Long) As Long

But how must they look like in Delphi?

support
Posts: 3254
Joined: 30 Mar 2005, 11:36
Contact:

Post by support » 15 Nov 2006, 15:57

Hello Alran;

We have added to the Delphi Demo respective functionality which allows saving opened CAD file to the BMP, JPEG or TIFF file formats. Please examine new procedure:

Code: Select all

<b>procedure</b> TfmMain.miSaveAsClick(Sender: TObject);
Updated <b>CADImageDLL</b> package is available on:
http://www.cadsofttools.com/download/cadimage.zip

Sergey.

please post questions to the forum or write to support@cadsofttools.com

Post Reply