I would like to write an application where you can use your hand instead of mouse. I wrote some WPF and use a hand style and it work good.
But I want to use this control outside and WPF window, just like normal mouse coursor. Is it possible to write it with Kinect For Windows V2 ?
What you need is a service, but not WPF app. So that it still can process input from Kinect in background, not only when your app is active and foreground.
You need to emit mouse move/click events in order to use it globally in the whole Windows OS. Here is one of examples on MSDN: https://social.msdn.microsoft.com/Forums/vstudio/en-US/1ea09f18-94f6-4f4f-bcba-d02da27beaa4/control-mouse-position-and-generate-click-from-program-c-winforms-aim-control-pc-from-serial?forum=csharpgeneral
Related
I want to detect mouse hovering over visual elements in .NET MAUI ( like buttons ). I cannot find any "onmouseover"/"ismouseover" events for this. How can I implement this.
All requests for "desktop" style control of keyboard and mouse have been consolidated under Maui issue: Desktop platforms: Mouse and Keyboard.
jfversluis' comment (at that issue or a related issue) indicates that no work in this area has yet been planned.
That issue is the place to discuss the topic (express interest in, or add any specific requirements or use cases), until there is a plan.
Until then, the work-around is generally to write Windows-only code in the Windows folder of your Maui project.
Unfortunately for mouse, that only gives window or desktop-relative mouse information. AFAIK, There currently is no easy way to interact with individual UI elements while the mouse moves. (Because Maui started as Xamarin started as mobile cross-platform code; touch devices don't have concept of cursor being moved around screen.)
A crude hack is to use AbsoluteLayout: position UI elements at exact positions, so you know where they are, then write (Windows-only) code that does your own "detection".
The next level of sophistication would be to write code that traverses a window's "visual tree" of UI elements, to detect what control the mouse is over. Maui must have such logic internally somewhere, to handle touch events. Unless it relies on each platform's UI code to decide that. TBD.
For now, Maui makes sense for apps that can live with a "touch" paradigm, rather than a "desktop" paradigm.
This isn't an answer per say, but as a suggestion you could try and determine when the mouse would be over the VisualElement and then use StateTriggers to actively apply a VisualState.
MAUI Triggers
Is there any kind of animation available for WPF app like expression animation in UWP?
Suppose I want to move a rectangle vertically with my mouse and another rectangle should move horizontally accordingly to the first one.
You can try with WindowsXAMLHost: it's a new feature, still in development, incorporated in the Windows Community Toolkit.
By using the WindowsXamlHost control, you can add built-in or custom UWP controls to the User Interface (UI) of your WPF or Windows Forms desktop application, even with custom functionalities.
Check the related MSFT Docs here: UWP controls in Desktop applications
Then get the companion app from the Win Store: Windows Community Toolkit Sample app
It will be a little bit tricky... but I'm sure that it is possible to do what you requested.
Best regards
I'm making a C# windows application, in which I've embedded a Windows Media Player in my form.
Now, instead of using the player in a normal way, I want to access its buttons, for e.g I want to hide its "Play" & "Pause" button.
In short, I want to customize the player according to my needs.
How can I do so?
You will have to hook the creation of the app. Mainly the windows mesaage WM Create or WM Paint.
There You have to check which window names the corresponding controls have. There are several tools to examine such things during runtime, which all use the windows hooking mechanism. However, I think this will fail for metro apps. You must read about hooks . Check codeproject.com for that, because You also will need to create at least one dll. And there is a good example in c, which surely can be ported to c#.Can I give You furthrer info?
I would like to display text like my company name on the window media player. I use DrawString function on Form onPaint event but it is covered by the window media player.
I also use Label control but it display square block on the player control even i set the back color to transparent. I develop KTV system it has two monitor one has form controls and another has player. Please advice me how should I do.
If your talking about the windows built-in media player then your going to have to get down and dirty with the Win32 API's, windows hooks, HWND, etc. You can't just paint a control on the window. What your talking about is some very low level windows coding.
Take a look at Spy++ (http://msdn.microsoft.com/en-us/magazine/cc163617.aspx). It's a tool from Microsoft that let's you delve into the details of a running application. It has a component called ManagedSpyLib which wraps the C++ windows libraries in a managed library to make the windows hooks calls easier. Be ready to learn more about the OS than you ever wanted to know. :-)
I'm trying to create a fullscreen WPF application and trying to implement a android like navigation drawer.
So in order to accomplish this I have to detect a swipe coming from offscreen, just like the Windows 8 charm bar.
But windows does not sent any touch/mouse events to the application if the swipe didn't start on the touchscreen (global hook isn't working too).
How am I able to detect those swipes starting offscreen just like Windows does it for the charm bar?
Just if it matters I'm using a Surface pro 3 with Win 8.1
You need to add manipulation events on your screen/window to detect if any swipe event takes place on your screen. There is no way that you directly get that event offscreen.
Referring to this link may help you.