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
 Draw Measurements result into the image
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

harry stahl

Germany
62 Posts

Posted - Feb 21 2023 :  12:39:53  Show Profile  Reply
I like the measurement functionality.

How can I write the information about the measurement info (the same appeareance) into the image, in the mouseup-event?



HS

xequte

38176 Posts

Posted - Feb 21 2023 :  14:23:16  Show Profile  Reply
Hi Harry

You can add a TIELayer with ruler mode enabled:

http://www.imageen.com/help/TIELayer.RulerMode.html

Nigel
Xequte Software
www.imageen.com
Go to Top of Page

harry stahl

Germany
62 Posts

Posted - Feb 21 2023 :  17:35:27  Show Profile  Reply
Yes, thank you, but my question is, how to paint the rulerinfo persistent to the image (not as layer, that escapes, when the measurement ends).

HS
Go to Top of Page

xequte

38176 Posts

Posted - Feb 21 2023 :  22:29:50  Show Profile  Reply
A layer will persist as long as needed (even if RulerMode is enabled). If you are wanting the same effect as the measure interactions (e.g. miMeasureLength), but have the layer persist after positioning, then use a layer creation interaction, such as mlClickCreateLineLayers (and in the OnNewLayer event enable RulerMode).

Then to "burn" it into the image you can use LayersMerge();

Nigel
Xequte Software
www.imageen.com
Go to Top of Page

harry stahl

Germany
62 Posts

Posted - Feb 27 2023 :  12:16:12  Show Profile  Reply
I do it so:

1. I prepare for writing: ievpic.MouseInteractLayers := [ mlCreateLineLayers ];
2. In newlayer-event I do this:

procedure TF_ieLayerTempl.ievpicNewLayer(Sender: TObject; LayerIdx: Integer; LayerKind: TIELayerKind);
begin
ievpic.Layers[Layeridx].RulerMode := TIERulermode.iermLabel;
end;

And in Mouseup-Event I call ievpic.layersmerge.

But as an result I get a black rectangle at the left side (or top), with the meausrement-info in it and connected with a line. But the measurement is not right, it seems that the size of the rectangle.with (or hight, depends on the direction the mouse is moved) is substracted.

Do I something wrong here?



HS
Go to Top of Page

xequte

38176 Posts

Posted - Feb 27 2023 :  20:10:32  Show Profile  Reply
Hi Harry

Strictly speaking it is better to use OnLayerNotify to know the get the end of layer creation:

procedure TForm1.ImageEnView1LayerNotifyEx(Sender: TObject; layer: Integer;
    event: TIELayerEvent);
begin
  if event = ielCreated then
    ImageEnView1.LayersMerge();
end;


But I cannot see any issues either way. Can you post some screenshots of what you are seeing?



Nigel
Xequte Software
www.imageen.com
Go to Top of Page

harry stahl

Germany
62 Posts

Posted - Feb 28 2023 :  13:20:03  Show Profile  Reply
I see this, if I move the mouse:


HS

Go to Top of Page

xequte

38176 Posts

Posted - Feb 28 2023 :  16:06:39  Show Profile  Reply
That looks correct. The left 5.03 is not anti-aliased because LayersFastDrawing is enabled, and the right 5.03 is the sizing hint.

Are you looking for the text to be above the line?

http://www.imageen.com/help/TIELineLayer.LabelPosition.html

Nigel
Xequte Software
www.imageen.com
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: