WinForms management for image map editing

In the WinForms application, I need to be able to interactively edit the "hot" areas on top of the image, and then be used as a kind of image map.

I tried to compose the UserControl with some floating rectangles (Microsoft.VisualBasic.PowerPacks ftw) on top of the PictureBox, but the result was not so pretty, especially with the problems of flickering and updating when moving the controls.

Does anyone know of an existing control that can help identify areas on the canvas? I think that graphical applications, for example, should deal with floating selections, but I could not track anything useful. Any ideas appreciated.

+4
source share
2 answers

I have such control ... without designer support

There is one small mistake (very intermittent) that I have not worked with yet, but it is somewhere deep in BCL. If you want to receive a copy, write me a letter (via www.sadeveloper.net), and I will send you a copy in two conditions.

  • standard immunity from any effects, is not responsible for any losses, accidental or otherwise ....
  • if you find a mistake and correct it, let me know how

Malio

+2
source

For the moment, stick to your current decision. Your flicker may be the result of not activating double buffering!

If double buffering is enabled, most (if not all) of your flicker should disappear.

In your InitializeComponent of both the user control and the form:

this.SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint | ControlStyles.DoubleBuffer,true); 

More information is available in this article.

+2
source

Source: https://habr.com/ru/post/1286674/


All Articles