Thank you very much for the implementation of ImageBox! Been finding it very useful! I do have a question on how best to add a floating label (e.g. to the lower left corner) within the ImageBox such that it is anchored to its border even when zooming and scrolling? I can do it by anchoring to the panel but I would much prefer to use the loaded image as the BackColor instead of color of my panel. I am currently using v1.2.1. Thank you in advance for your help!
Hello,
Welcome to the forums and thanks for the question. The functionality you're looking for is already built into
ImageBox without needing to use actual
Label controls. Have you tried this or does it not fill your needs? As well as the standard
Text,
Font and
ForeColor properties, the following custom properties are available
- TextAlign: The text position
- TextBackColor: The background color (you can set this to Color.Transparent)
- TextPadding: Offsets
- ScaleText: If set to true, the text size scales with the zoom, or leave at false to stay at the fixed font size
- TextDisplayMode: Specifies if the text is anchored to the control or the client image (or not shown at all)
See the
Text Demonstration window in the demo application for an example.
(https://www.cyotek.com/files/forumimages/imagebox-text.png)
Hope this helps, let me know if otherwise.
Regards;
Richard Moss
Edit: Updated as I forgot to mention
TextDisplayMode.