I'm making a little screenshot application. Anything is working so far.
Now I want to add multiScreen support. I want a key that makes a screenshot of the active monitor (with the mouse cursor on it).
I thought about calculating the Rectangle of all screens, get the cursor possition and calculate on which monitor the coordinates are. But I have don't get it work!
Can anyone provide me a code snippet? Thank you
Related
I am developing a WPF App that uses Kinect v2, and I use the hand to simulate the mouse. It works but I have a little problem - when I close the hand I simulate a click but the cursor drops its position a little bit relative to when the hand was open and sometimes it will end in a click in the wrong button or place.
Any ideas on how can I solve this?
I already tried to track the wrist and the thumbs instead of the hand but the problem still happens.
Thanks!
Here are some ideas:
Filter and smooth the hand position data a bit more. For a UI/menu system, it should be acceptable to have some latency as it doesn't require reduced latency as much as other uses.
Modify the hand position based on the hand's open/close state. Introduce a constant to bump up the hand position when the hand is closed, with appropriate smoothing to get this to feel and look correct
Keep a list of hand positions and use the data from a few frames before (though it might be tricky to get this to feel and look correct)
As a note, also consider these points:
Use bigger buttons. Buttons should have appropriate spacing, placement, and sizes. The app's UI should be specifically designed for a Kinect application.
Use a different gesture for a mouse click, such as push or press which is the recommended approach in the Kinect Human Interface Guidelines 2.0
I am making an overlay program with C# that will have an overlay for games. I am currently using a borderless form with a transparent background and a picture box to draw pictures to the screen, but I can't click the window behind the form. I have set the form to be always on top so that I can play games and the UI stays, but every time the mouse goes over the form in the game if I click the focused window switches to my form, preventing game interaction.
I have tried using functions to just draw images to the screen without using forms, but I cannot work out how to do that.
All I want is things like an external menu/crosshair and such, for use in minecraft. As for the menu, I could make my own media controls and such, and the crosshair would be useful because I hate the default crosshair. I could draw shapes to the screen, but if I don't use pictures the crosshair might look tacky.
A possible solution is a per pixel alpha blending window.
Here is a good starting point: Per Pixel Alpha Blend in C#
The example source code should give you the idea.
Hope this helps
i'd appreciate if someone could give me a hint :)
I have my Windows Forms C# app and i put the start position to the right side of the screen. Now i'd like it to appear only when the user's cursor touches right side boundary of the screen. How can i track the position of the cursor and show the form?
Thank you in advance!
Answering in terms of decomposing the question:
How do I know where the right side of the screen is?
How to retrieve the Screen Resolution from a C# winform app?
How do I know what the position of the mouse cursor is?
http://msdn.microsoft.com/en-us/library/system.windows.forms.cursor.position.aspx
That should get you started. I'm assuming you already know how to use a Timer to repeatedly do things (such as poll for the mouse position).
I am trying to detect how hard someone is pushing the wp7 screen for a drawing application. Is there a way to detect how big surface area is where the screen is being touched. I reckon that would be a reasonably accurate way to determine how hard the screen is being touched - A light touch would have a small touch surface area while a hard press would have a bigger touch area.
Has anyone ever tried something like this?
You can determine this with a very simple equation.
Pressure = Force / Area
To solve this, you would need to know at least two of the variables. Suppose you can find the area from the phone's sensors. You would still need to know the pressure in order to calculate the force or in other words, how hard the user is pressing the screen.
Hope this helps you!
I have a wpf window that has a height of 2000 with an actual desktop height of about 1000. Obviously about half of the window is off screen. Even though the window extends below the screen, the mouse will not move down to that area. I do want this content to be off-screen, and I want the mouse to be able to move over it and click on elements if the mouse is positioned over an element at that position. I don't want to change my screen resolution as some content absolutely has to be off the screen. Not sure how to go about this.
Cursor delimiting is not done by the application, but by Windows itself. To my knowledge there is no way to have your cursor pointing off the screen.
You could simulate what you want by doing what many games do. Do not draw the Windows cursor, draw a custom one in your app window. Force the real cursor (not being drawn) to stay in the center of the monitor. Every time the user moves the real cursor, move your application's cursor accordingly and re-place the real cursor to the center of the screen.
This will give the illusion of what you'd like, but I don't think WPF can handle this.
There is not an off the screen cursor position in Windows. I think the mouse is bounded by the screen resolution, even if windows are not.
If you take a look at the screen shots of MaxiVista you'll find a screen shot showing the Device Manager:
Device Manager http://www.maxivista.com/pics/screenshots/vista_devicemanager_en.gif
As you can see they simply wrote a virtual display adapter, which provides its own display size. So windows will be informed about a available size of e.g. 2560x1600 would be possible and allows these bounds for all windows and the mouse. Now it is up to the display driver to forward the right portions of this virtual screen to the current real display adapters so that the right part is shown on each physical device.
I think it is possible. This program will enable to use a secondary computer as an extra monitor. There are several programs that can let you know the coordinates where your mouse cursor is positioned. For example AutoIt will do that easily.
When you install autoit it comes with this utility that will let you know the cordinates where you position the mouse. When I took the screen capture the mouse does not show up but I draw a blue dot where the mouse was located. Note that the cordinates where 710, 1464. Right now my screen resolution is 1200 * 1920 (my monitor is rotated). So with Autoit I am able to position my mouse cursor by doing something like
When I run that autoit program it will move the mouse to that location. The answers to this question seem to be right cause I am not able to move the mouse any further than 1200 to the right. In other words executing MouseMove(2500,800) will result in moving the mouse to 1200,800. Now the interesting part is how come I am able to move the mouse to (2500,800)! if I use This program In other words executing MouseMove(2500,800) now works with Autoit and the mouse actually moves to the other computer (maxivista has to be running). maxivista shows that there can be a way of moving the mouse outside the resolution of your screen.