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
 TIELineLayer stroke doubles or disappears during drag in ImageEnView
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

Xardelane

France
2 Posts

Posted - May 07 2025 :  14:21:26  Show Profile  Reply
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

xequte

38978 Posts

Posted - May 08 2025 :  00:35:41  Show Profile  Reply
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
Go to Top of Page

Xardelane

France
2 Posts

Posted - May 08 2025 :  14:33:52  Show Profile  Reply
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
Go to Top of Page

xequte

38978 Posts

Posted - May 08 2025 :  18:58:43  Show Profile  Reply
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
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: