开发者

Making selection of visual elements in Canvas easier

开发者 https://www.devze.com 2023-02-25 18:40 出处:网络
I have a Canvas based custom control that enables selection, dragging and resizing of visual children. 开发者_如何学GoI have so far Lines, Rectangles (without background) and images. Problem is, for s

I have a Canvas based custom control that enables selection, dragging and resizing of visual children. 开发者_如何学GoI have so far Lines, Rectangles (without background) and images. Problem is, for selection, lines for example are hard to select obviously as they are 1 pixel high. Could you suggest a way to make them easily selectable? I'd like something along the lines of Visual Studio's selection, in which there are some pixels of "miss tolerance" when selecting something thin like a grid, you don't need to hit the exact pixel the line is at, few pixels around it are just as good, but I'm not sure how to implement that in WPF. Please help?

Thank you.


Perhaps what you are looking for can be easily achievable by using Adorner

0

精彩评论

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