Hi fabrizio,
The result looks good now.
But is it the right way?
If i set TargetExtent = 500.0 mm
gets the error "EOutOfResources"
{----------------------------}
{}procedure TForm1.DrawTarget;
{----------------------------}
const
dpi = 254;
multi = dpi / 2.54;
TargetExtent = 50.0; //50.0mm
var h, tx:integer;
begin
tx := Round(TargetExtent * multi);
ImageEnVect1.RemoveAllObjects;
ImageEnVect1.Proc.ImageResize(tx ,tx); <---------
//draw a box
h := ImageEnVect1.AddNewObject;
ImageEnVect1.ObjKind[h] := iekBOX;
// ImageEnVect1.ObjPenWidth[h] := Round(0.05 * multi);
ImageEnVect1.SetObjRect(h, Rect(0, 0, tx, tx));
AddRingEx(0.0, 0.0, 45.5, TargetExtent);
AddRingEx(0.0, 0.0, 40.5, TargetExtent);
AddRingEx(0.0, 0.0, 35.5, TargetExtent);
AddRingEx(0.0, 0.0, 30.5, TargetExtent);
AddRingEx(0.0, 0.0, 25.5, TargetExtent);
AddRingEx(0.0, 0.0, 20.5, TargetExtent);
AddRingEx(0.0, 0.0, 15.5, TargetExtent);
AddRingEx(0.0, 0.0, 10.5, TargetExtent);
AddRingEx(0.0, 0.0, 5.5, TargetExtent);
AddRingEx(0.0, 0.0, 0.5, TargetExtent);
ImageEnVect1.Zoom := ImageEnVect1.GetIdealZoom * 0.9;
end;{DrawTarget}
{------------------------------------------------------}
{}procedure TForm1.AddRingEx(x,y,d,TargetExtent:double);
{------------------------------------------------------}
var h: integer;
r: double;
begin
r := (d / 2.0);
h := ImageEnVect1.AddNewObject;
ImageEnVect1.ObjKind[h] := iekELLIPSE;
// ImageEnVect1.ObjPenWidth[h] := Round(0.05 * multi);
ImageEnVect1.SetObjRect(h, Rect(Round((x + (TargetExtent / 2) - r) * multi),
Round((y + (TargetExtent / 2) - r) * multi),
Round((x + (TargetExtent / 2) + r) * multi),
Round((y + (TargetExtent / 2) + r) * multi)));
end;{AddRingEx}
thanks a lot,
Kostas