CADImage show point problem

Discuss and ask questions about CAD plugins for 3rd party software: IrfanView, XnView, Total Commander, Konvertor FM.

Moderators: admin, support, SDS

Post Reply
ersbg
Posts: 2
Joined: 19 Nov 2012, 19:45

CADImage show point problem

Post by ersbg » 20 Nov 2012, 11:12

Hi all.
I download a package of a new version of a Cadimage.dll with demo in the package. But in this demo Show Point from menu don't work.
The code from demo to locate a point is:
procedure TfmMain.mmiShowPointClick(Sender: TObject);
var
vScale: Double;
vRect: TRect;
vCADRect: TFRect;
vRes: Integer;
vCenter: TPoint;
ShowMarker: Boolean;
vFRect, vDefRect: TFRect;
vFPoint: TFPoint;
begin
GetExtentsCAD(FCADFile, vCADRect);
ShowMarker := FShowFndPntMarker;
vDefRect := GetDefDrawRect;
vScale := (vDefRect.Right - vDefRect.Left) / (vCADRect.Right - vCADRect.Left);
vRes := GetPointParams(vCADRect, vScale, FCADPoint, ShowMarker);
if vRes = 0 then Exit;
if (vCADRect.Left < FCADPoint.X) and (FCADPoint.X < vCADRect.Right) and
(vCADRect.Bottom < FCADPoint.Y) and (FCADPoint.Y < vCADRect.Top) then
begin
FShowFndPntMarker := ShowMarker;

vFRect := GetDefDrawRect;
vRect := RoundRect(vFRect);

vCenter.X := pbImage.ClientWidth div 2;
vCenter.Y := pbImage.ClientHeight div 2;

FDrawRect := vCADRect;
OffsetFRect(FDrawRect, -FDrawRect.Left, -FDrawRect.Top, -FDrawRect.Z1); // 100%
FDrawRect.Bottom := -FDrawRect.Bottom;

ScaleRectangleF(vScale, MakeFPoint(0, 0), FDrawRect);

vFPoint.X := FDrawRect.Right * FCADPoint.X / (vCADRect.Right - vCADRect.Left);
vFPoint.Y := FDrawRect.Bottom * (1 - FCADPoint.Y / (vCADRect.Top - vCADRect.Bottom));
vFPoint.Z := 0;

OffsetFRect(FDrawRect, -(vFPoint.X - vCenter.X),
-(vFPoint.Y - vCenter.Y), 0);

Invalidate;
end
else
ShowMessage('Seleted point does not belong to the drawing');
end;
On old version this function is work perfectly but in new the source is changed and this didn't work.
Can somebody help me.

Thanks.

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

Re: CADImage show point problem

Post by support » 22 Nov 2012, 13:37

Hello.
The incorrect results of ShowPoint function caused by changes in library kernel. We will consider this problem.

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

Post Reply