开发者

Drawing a temporary 'select' rectangle on a drawing area [closed]

开发者 https://www.devze.com 2023-01-15 08:09 出处:网络
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.

We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.

Closed 3 years ago.

Improve this question

I have a complex drawing on a Gtk DrawingArea widget and I wish to provide the user with a way to select a rectangle on it to expand for a closer view. I have managed to get the necessary mouse button events sorted out so that the rectangle can be selected, but it would be desirable to have the actual rectangle drawn on the display, moving around along with the mouse. I need to know how one does this without disturbing the underlying d开发者_如何学Crawing (i.e. so I can erase the temporary rectangle as it changes size and shape without having to redraw the underlying picture).

Could someone tell me the correct name for this effect (so that I can google it) or does anyone know of an example, or a keyword to search the Gtk documentation?

Thank you.


You are looking for the Rubber Band technique.

0

精彩评论

暂无评论...
验证码 换一张
取 消