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
 How to adjust font size on the line ruler?
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

klinikaxp

Poland
11 Posts

Posted - Oct 26 2020 :  03:56:42  Show Profile  Reply
I create a line with ruler to measure distance (I set: IE.MouseInteractGeneral := [miMeasureLength]). The font is automatically adjusted: when the line is short, the font is small. When user moves then mouse and the line becomes longer, the font is increased. It is very useful. But the line disappears after MouseUp event.

I want to leave the line, so I create it this way:
IE.MouseInteractGeneral := [];
IE.MouseInteractLayers := [mlClickCreateLineLayers];

and OnNewLayer I specify:
TIELineLayer (ImageVect.CurrentLayer).IsRuler := True;
TIELineLayer (ImageVect.CurrentLayer).LabelFont.Size := 40;
TIELineLayer (ImageVect.CurrentLayer).LabelFillColor := clNone;
TIELineLayer (ImageVect.CurrentLayer).LabelPosition := ielpAutoAbove;
TIELineLayer (ImageVect.CurrentLayer).LabelFont.Size := RULER_FONT_SIZE;

And now I have got two questions:
1. How can I modify LabelFont size according to line length? I tried to set it using OnMeasure, OnMouseMove events, but it was not working well.

2. Is it possible to ignore units in Ruler Text? All measurement is made in mm, so I would like to display on the ruler only "12.34" instead of "12.34 mm". Can I configure something to reduce it?


xequte

38616 Posts

Posted - Oct 26 2020 :  15:52:15  Show Profile  Reply
Hi

1. Autoshrinking of large text is handled by the TextOverflow property:

https://www.imageen.com/help/TIELineLayer.TextOverflow.html


2. There is not an event to customize the text for when IsRuler=True. You could turn off IsRuler and set the text value yourself (e.g. when the layer is sized) using the value of:

https://www.imageen.com/help/TIELineLayer.RulerValue.html

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

klinikaxp

Poland
11 Posts

Posted - Oct 26 2020 :  17:07:44  Show Profile  Reply
It was exactly what I was looking for! Thank you!
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: