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

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 TIELineLayer stroke doubles or disappears during drag in ImageEnView

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

View 
UserName:
Password:
Format  Bold Italicized Underline  Align Left Centered Align Right  Horizontal Rule  Insert Hyperlink   Browse for an image to attach to your post Browse for a zip to attach to your post Insert Code  Insert Quote Insert List
   
Message 

 

Emoji
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Black Eye [B)]
Frown [:(] Shocked [:0] Angry [:(!] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
Xardelane Posted - May 07 2025 : 14:21:26
Hello ImageEn team,

I’m running into a strange behavior with the TIELineLayer object in my Delphi/ImageEnView project.
When I attempt to move one of my “frontier” lines (vertical or horizontal), the line’s stroke width either doubles during the drag operation or it disappears from the view.
I also notice that the line returns to its correct thickness or becomes visible again when I left-click anywhere in the TImageEnView area.

Environment:
  • Delphi 12.3, 32-bit
  • ImageEnView 14.0.1 (latest)


Any ideas what might be going wrong, or how to reliably update a TIELineLayer’s endpoints without it disappearing? Thanks in advance for your help!

I’ve also included a GIF to illustrate the problem:


I’ve attached a ZIP of the minimal reproducible project here:
attach/Xardelane/20255714429_TEST_IMAGEEN.zip
7217.07 KB

Below is a placeholder where I’ll paste the reduced test case code:
unit MainUnit;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, hyiedefs, hyieutils, iexBitmaps, iesettings, iexLayers, iexRulers, iexToolbars,
  iexUserInteractions, imageenio, imageenproc, iexProcEffects, ieview, imageenview;

type
  TMainForm = class(TForm)
    ImageEnView: TImageEnView;
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  MainForm: TMainForm;

implementation

{$R *.dfm}

procedure TMainForm.FormCreate(Sender: TObject);
var
  LineIdx: Integer;
begin
  ImageEnView.AutoShrink := True;
  ImageEnView.LayerOptions := ImageEnView.LayerOptions + [loPreventOutOFBounds];
  ImageEnView.MouseInteractLayers := [miMoveLayers];
  ImageEnView.IO.LoadFromFile('..\..\drop.jpg');

  LineIdx := ImageEnView.LayersAdd(Point(10, 0), Point(10, 400), clBlue, 2);
  with TIELineLayer(ImageEnView.Layers[LineIdx]) do
  begin
    Locked := False;
    Selectable := True;
    LineStyle := iegpSolid;
    VisibleBox := False;
  end;
end;

end.


drop.jpg :



Best regards,
Xardelane
3   L A T E S T    R E P L I E S    (Newest First)
xequte Posted - May 08 2025 : 18:58:43
Oh, I see. There is a rounding issue that can occur at certain x positions. Please email me for a fix in the latest beta.

Nigel
Xequte Software
www.imageen.com
Xardelane Posted - May 08 2025 : 14:33:52
Hi Nigel,

Thank you for taking the time to help.
All my monitors (primary IIYAMA ProLite B2776HDS and two secondary IIYAMA G-Master G2530HSU) run at 1920×1080 with 100% scaling.
I’ve also tried all three LayerFastDrawing modes—iefDelayed, iefFast, and iefNormal—but the issue still occurs. I ran the test executable on another PC, and the problem persists there as well.

The problem occurs as soon as I apply a bit more force when dragging with the mouse; once it appears, it repeats with both mouse drags and keyboard nudges.

Any other ideas would be greatly appreciated!

EDIT: I just tested on a Lenovo ThinkPad laptop, and the problem is present there as well. As soon as the line starts to thicken during a drag, it’s even easier to reproduce the issue by moving the line with the keyboard.

Thanks again,
Xardelane
xequte Posted - May 08 2025 : 00:35:41
Hmm, your demo works fine for me (both the included test_imageen.exe and when I compile it myself).

What is the scaling of your monitor? Does changing LayersFastDrawing make any difference?

Nigel
Xequte Software
www.imageen.com