Error on export code
Moderators: SDS, support, admin
-
- Posts: 49
- Joined: 06 Feb 2008, 03:26
- Location: Mexico
Error on export code
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;
[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!
Re: Error on export code
Hello!
When does this error arise? While compiling or while running a demo?
Sergey.
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
Chat support on Skype: cadsofttools.support
-
- Posts: 49
- Joined: 06 Feb 2008, 03:26
- Location: Mexico
Re: Error on export code
Are trying to compile Viewer demo in the CAD Import VCL package or you added this code in to your application?
Sergey.
Sergey.
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support
Chat support on Skype: cadsofttools.support
-
- Posts: 49
- Joined: 06 Feb 2008, 03:26
- Location: Mexico
Re: Error on export code
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
thanks Sergey
Everything is Posible!
Re: Error on export code
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.
Sergey.
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support
Chat support on Skype: cadsofttools.support
-
- Posts: 49
- Joined: 06 Feb 2008, 03:26
- Location: Mexico
Re: Error on export code
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

cheers Pavel
Everything is Posible!
Re: Error on export code
Hi Pavel,
So the solution was near.
Sergey.
So the solution was near.

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