简体   繁体   中英

c#: draw mouse circle outside winform

My project is about to control the mouse with the new MS Kinect in C# + Kinect SDK. I decided to use a WinForm Project in VS2010. So far, I can move the mouse with my hand and can do some mouseclicks inside and outside my Form. ( So I can control my whole PC with my hands :) ) To control my mouse cursor from a distance, I need to "highlight" it with fe a red circle. So I coded some lines and I can draw a red circle around my mouse cursor and it works fine inside that form. But I want to see the same circle on my desktop too.

Here is an Image to show you my problem.

鼠标问题

The Image shows you, that the second circle is beeing cut, when I leave my mouse outside my Form Window, but it shouldn't !

Any ideas ???

Make a new borderless, transparent, topmost window. Then draw your circle within the window, and periodically pole for the mouse coordinates and recenter the window.

Here's something that appears to be a solution to your problem. I haven't tested it, but I will shortly.

Draw directly to screen

EDIT

I have been unable to get the solution to work, if someone else can I'd be happy to see what you've done.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM