Error on export code

Discuss and ask questions about CAD VCL (Delphi and C++ Builder).

Moderators: SDS, support, admin

Post Reply
prodriguezdlt
Posts: 49
Joined: 06 Feb 2008, 03:26
Location: Mexico

Error on export code

Post by prodriguezdlt » 14 Apr 2008, 19:42

hi, when im trying to export to bmp or jgp, in the code i get this error:

[DCC Error] Unit1.pas(563): E2010 Incompatible types: 'SGExport.TsgExportFormat' and 'Unit1.TsgExportFormat'

the weird thing is that i havent changed any code, and i've never get'd this error before...can u please help me here??

this is the rest of the code:


procedure TForm1.SmExportarClick(Sender: TObject);
var
E: TsgExport;
vFileName: string;
vWidth, vHeight: Integer;
vRatio: Double;
begin
if sgPaintBox.Empty or not SavePictureDialog.Execute then Exit;
vFileName := SavePictureDialog.FileName;
vWidth := sgPaintBox.Picture.Graphic.Width;
vHeight := sgPaintBox.Picture.Graphic.Height;
if vHeight <> 0 then
vRatio := vWidth / vHeight
else
vRatio := 1;
if vRatio <= 1 then
begin
vHeight := Screen.Height;
vWidth := Round(vHeight * vRatio);
end
else
begin
vWidth := Screen.Width;
vHeight := Round(vWidth / vRatio);
end;
case SavePictureDialog.FilterIndex of
1:
if AnsiLowerCase(ExtractFileExt(vFileName)) <> '.bmp' then
vFileName := vFileName + '.bmp';
2:
if (AnsiLowerCase(ExtractFileExt(vFileName)) <> '.jpg')
or (AnsiLowerCase(ExtractFileExt(vFileName)) <> '.jpeg') then
vFileName := vFileName + '.jpg';
end;
E := TsgExport.Create;
try
E.ExportTo(sgPaintBox.Picture.Graphic, vFileName,
TsgExportFormat(SavePictureDialog.FilterIndex-1), vWidth, vHeight);
finally
E.Free;
end;
end;
Everything is Posible!

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

Re: Error on export code

Post by support » 15 Apr 2008, 14:26

Hello!

When does this error arise? While compiling or while running a demo?

Sergey.
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support

prodriguezdlt
Posts: 49
Joined: 06 Feb 2008, 03:26
Location: Mexico

Re: Error on export code

Post by prodriguezdlt » 15 Apr 2008, 16:42

the error appears when im compiling!
Everything is Posible!

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

Re: Error on export code

Post by support » 15 Apr 2008, 18:10

Are trying to compile Viewer demo in the CAD Import VCL package or you added this code in to your application?

Sergey.
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support

prodriguezdlt
Posts: 49
Joined: 06 Feb 2008, 03:26
Location: Mexico

Re: Error on export code

Post by prodriguezdlt » 16 Apr 2008, 01:52

this code its in my application, but the wweird thing is that ive always have it there, and suddenly the erro appears! i thiink its weird, cause i havent change the procedure's code....
thanks Sergey
Everything is Posible!

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

Re: Error on export code

Post by support » 16 Apr 2008, 09:00

If your project could be compiled earlier and it stopped to be compilable and there were no changes in your code the reason of the problem is that CAD Import VCL library or library paths were changed. Please check library paths in Delphi and project's environment.

Sergey.
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support

prodriguezdlt
Posts: 49
Joined: 06 Feb 2008, 03:26
Location: Mexico

Re: Error on export code

Post by prodriguezdlt » 28 Apr 2008, 12:53

the error was because i accidentally put an SGImage component, and then deleted it, but in the uses of my main form the SGIMAGE remained, so i just deleted it from uses, and that was the problem...so..solved ;)

cheers Pavel
Everything is Posible!

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

Re: Error on export code

Post by support » 28 Apr 2008, 13:14

Hi Pavel,

So the solution was near. :-)

Sergey.
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support

Post Reply