ConvertCADToJPEG
Moderators: SDS, support, admin
ConvertCADToJPEG
There is a function ConvertCADToJPEG(const ASrc, ADest: WideString; AMaxDimansions: Integer): WordBool;
How to define the parameter AMaxDimansions? could you give me a small sample code?
Thank you in advance.
Love all, trust a few, do wrong to none.
How to define the parameter AMaxDimansions? could you give me a small sample code?
Thank you in advance.
Love all, trust a few, do wrong to none.
Use the following procedure:
//-----------------------------------------------------------------------
The method ConvertCADToJPEG doesn't always work correctly. This problem will be solved in the next release.
please post questions to the forum or write to support@cadsofttools.com
Code: Select all
<b>procedure</b> TfmMain.ShowPreview;
<b>var</b>
vSrc, vDst: WideString;
vPreviewImage: TImage;
<b>begin
if</b> OpenDialog1.Execute <b>then
begin</b>
vSrc := OpenDialog1.FileName;
// convert to temporary file
vDst := ExtractFilePath(Application.ExeName) + 'temp.jpg';
<b>if</b> FCADViewX.ConvertCADToJPEG(vSrc, vDst, 600) <b>then
begin</b>
vPreviewImage := TImage(FindComponent('imPreviewImage'));
<b>if</b> vPreviewImage = <b>nil then
begin</b>
vPreviewImage := TImage.Create(Self);
vPreviewImage.Width := 800;
vPreviewImage.Height := 600; // min dimension of vPreviewImage
vPreviewImage.Name := 'imPreviewImage';
vPreviewImage.Center := True;
vPreviewImage.DragKind := dkDock;
vPreviewImage.DragMode := dmAutomatic;
vPreviewImage.ManualDock(<b>nil</b>);
<b>end</b>;
vPreviewImage.Hide;
vPreviewImage.Show;
vPreviewImage.Picture.LoadFromFile(vDst);
<b>end</b>;
<b>end</b>;
<b>end</b>;
The method ConvertCADToJPEG doesn't always work correctly. This problem will be solved in the next release.
please post questions to the forum or write to support@cadsofttools.com