ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 Arrow tip position offset when ObjPenWidth > 1 (ObjBeginShape = iesOUTARROW)
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

Mickael

France
1 Posts

Posted - Jul 08 2026 :  05:25:30  Show Profile  Reply
Hi,
I'm using TImageEnVect in Delphi 10.2 to let users draw a freehand line and convert it into an arrow (tip placed at the starting point of the drawing).

Issue: When the arrow is drawn, the tip of the arrowhead appears slightly offset (up/left) from the actual starting point clicked by the user. The offset is small but very noticeable once the arrowhead shape is applied.

Code used to create the object:
pascalimageenvect.Cursor := crIECrossSight;
imageenvect.ObjBrushStyle[-1] := bsSolid;
imageenvect.ObjShapeWidth[-1] := dmFich.tParamsLARGEUR_BOUTS_FLECHES.Value;
imageenvect.ObjShapeHeight[-1] := dmFich.tParamsLONGUEUR_BOUTS_FLECHES.Value;
imageenvect.ObjPenWidth[-1] := dmFich.tParamsEPAISSEUR_FLECHES.Value;
imageenvect.ObjPenStyle[-1] := psSolid;
imageenvect.ObjAspectRatio[-1] := true;
ImageEnVect.ObjEndShape[-1] := iesNONE;
ImageEnVect.ObjBeginShape[-1] := iesOUTARROW;
imageenvect.MouseInteractVt := [miPutLineLabel];
imageenvect.InsertingPen.Color := COLOR_JAUNE;
imageenvect.InsertingPen.Mode := pmCopy;
imageenvect.InsertingPen.Width := 5;
imageenvect.InsertingPen.Style := psSolid;
imageenvect.MouseInteract := [];

What I've tested so far:

  • Setting ObjAspectRatio[-1] := false => no change, offset still present.
  • ObjPenWidth[-1] := 1 => the offset completely disappears.
  • Drawing a strictly horizontal line, then a strictly vertical line (with the original ObjPenWidth value) => the offset appears identically in both cases, so it doesn't seem to be related to the line angle or a trigonometric rounding issue.
  • Zoom level is currently above 100% — mentioning this in case it's relevant, though the offset behavior described above was consistent regardless.


Conclusion so far: The offset seems proportional to ObjPenWidth and appears to affect only the rendering of the arrowhead tip, not the underlying line coordinates (I checked with GetObjRect and the stored rectangle looks correct).

Question: Is there a separate property to control the pen/outline width of the arrowhead shape independently from the line's ObjPenWidth? Or is this a known rendering behavior/bug when combining a thick pen with iesOUTARROW?
Any guidance would be appreciated — happy to provide a screenshot showing the before/after offset if useful.

Thanks!

Image with ObjPenWidth[-1] := dmFich.tParamsEPAISSEUR_FLECHES.Value



Image with ObjPenWidth[-1] := 1



CALON Mickaël
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: