Page 1 of 1

Error on export code

Posted: 14 Apr 2008, 19:42
by prodriguezdlt
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;

Re: Error on export code

Posted: 15 Apr 2008, 14:26
by support
Hello!

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

Sergey.

Re: Error on export code

Posted: 15 Apr 2008, 16:42
by prodriguezdlt
the error appears when im compiling!

Re: Error on export code

Posted: 15 Apr 2008, 18:10
by support
Are trying to compile Viewer demo in the CAD Import VCL package or you added this code in to your application?

Sergey.

Re: Error on export code

Posted: 16 Apr 2008, 01:52
by prodriguezdlt
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

Re: Error on export code

Posted: 16 Apr 2008, 09:00
by support
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.

Re: Error on export code

Posted: 28 Apr 2008, 12:53
by prodriguezdlt
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

Re: Error on export code

Posted: 28 Apr 2008, 13:14
by support
Hi Pavel,

So the solution was near. :-)

Sergey.