I'm trying to write code to access the camera function of a Windows 8 tablet in a WPF application.
The threads I've found all seem to point to using DirectShow.Net or MediaKit. Neither of these projects have been updated in over 3 years. Is still the best way to go or are there any other ideas on how to do it?
I'm going to answer my own question here.
From what I've found, in Windows 8, you should be using the Windows.Media namespace's MediaCapture class to do it. DirectShow and MediaKit are for legacy systems.
I am in the middle of getting this to work, but in case anyone needs help, here's the best sample I've found so far:
http://blogs.msdn.com/b/eternalcoding/archive/2013/10/29/how-to-use-specific-winrt-api-from-desktop-apps-capturing-a-photo-using-your-webcam-into-a-wpf-app.aspx
Related
I am new to this business and I want to make an application related to Bluetooth LE. I don't know where to start, I want to do it using a library. I searched libraries such as 32feet.Net, InTheHand.BluetoothLe, Plugin.BluetoothLe, ble.net but I could not figure out how to make a windows form app or what can I do and where to start. Can anyone help?
Bluetooth on windows has always been difficult with very few examples to learn from.
I think the most up to date way is probably to make a UWP application and use the Windows.Devices namespace. I've never tried it that way though.
There are examples of this here: https://github.com/Microsoft/Windows-universal-samples/tree/master/Samples/BluetoothLE
If you want to use 32feet.net, you will find some sample code in an old question of mine here:
Bluetooth Pairing (SSP) on Windows 10 with 32feet.NET
I got the basics of searching for devices working, but never got the pairing to work how I wanted, and the question never got an answer despite someone placing a bounty on it. Hopefully it at least puts you on the right path.
Can somebody point me to some good Monogame walkthroughs or tutorials?
The reason I am asking this question is because when I try to create a new project in VS2012, I get the following options
But all the tutorials or walkthroughs (like this one) have the following options and develop using xaml -
Now, I guess this is because I am using Windows 7. So can somebody give me tutorials that are actually targeted to my case.
NOTE: I am trying to develop simple and normal games for Windows 7, nothing fancy like XBox, Windows 8 or Android. Where can I find appropriate getting started walkthroughs for my situation?
There's a few MonoGame tutorials listed on the forums here:
https://monogame.codeplex.com/discussions/439595
And a related post about ideas for new MonoGame tutorials here:
https://monogame.codeplex.com/discussions/439728
As previously mentioned, the MonoGame API is syntactically compatible with XNA so most XNA tutorials will also be helpful.
There is some trickiness around dealing with content, the simplest method in my opinion is to just add it to the Content folder, set it to Content / Copy if newer in the properties window and refer to it with the file extension in code (unless it's an XNB file).
MonoGame is a great project and I highly recommend it if you want to make games for many platforms, something you may want to do sooner or later. However, it still has a few missing features compared to XNA so life may be easier in the short term, while you're learning if you stick with XNA.
Last point, your nearly there anyway, based on your first screenshot I would choose the MonoGame Windows OpenGL Project if you want to target windows 7. Learn how to render your first sprite and you may decide that proceeding with MonoGame is not so bad after all.
Most MonoGame tutorials will deal with Windows 8 or non-windows. This is because MonoGame was created as an alternative to XNA for easy porting from XNA-supported platforms (such as windows 7) to non-XNA supported platforms (such as a Windows Store App).
Note that you can still use XNA in Windows 8, but you'd be creating a desktop app, not a Windows Store App.
A great resource of example is the multi-platform sample project which contains several examples made to work on all platforms
https://github.com/Mono-Game/MonoGame.Samples
The platformer sample is on all platforms and the rest are in progress, but all show a great way to setup your project ready to tackle all the platforms out there!
I'm developing a c# touch application for windows 8, desktop mode, and i'm unable to find the best approach to do it. My question is: Should I use the existent Windows 7 Touch API c# or there is a new multitouch c# API that can be used to develop windows 8 desktops apps?
I know that windows 8 have legacy support for the win7 touch api, just need some insight and feedback if still is the best and only way to do it.
Does anyone had a previous experience with this problem?
Edited: I found this article: http://software.intel.com/en-us/articles/touch-gestures , basically the UIElement exposes methods that enable touch manipulation. Maybe this is the way to go. Any thoughts?
Thank you.
Windows 8 API has a new API based on WM_POINTER message see http://msdn.microsoft.com/en-us/library/hh454916(v=vs.85).aspx
Windows 7 API has some drawbacks, see http://the-witness.net/news/2012/10/wm_touch-is-totally-bananas/
WM_TOUCHxxx messages are not prone to this problem:
http://social.msdn.microsoft.com/Forums/en-US/ce6d630a-b345-46ac-88ef-773704986d62/touch-responsiveness-issue-how-to-resolve-jagged-nonsmooth-lines?forum=winappswithcsharp
Both the WM_TOUCHxxx and WM_POINTERxxx message will be prone this this problem:
https://web.archive.org/web/20150709083602/https://connect.microsoft.com/VisualStudio/feedback/details/903760/wpf-touch-services-are-badly-broken
If your c# desktop application is using WPF, your only viable option is to implement your own TOUCHDEVICE that fixes these underlying issues, since it appears Microsoft has decided WPF touch is no longer important.
It depends on what actually are your needs in your app.
If you only want new fast ways to rotate and zoom objects, maybe the WPF Manipulation API is all you need.
If, however, you need to handle multiple fingers on your GUI independently, or in a custom way, you simply handle the usual OnTouchDown, OnTouchMove, and other events.
Please note that, however, multi-touch is only available from inside a single window. In other words: you can multi-touch two objects on the same window, but you won't be able to multi-touch two objects that reside on different windows. If you want multi-touch, multi-window funcionality, you need to:
Use .NET 4.7
Change some configuration in your WPF app
I'm developping a SmartDevice application (Pocket PC 2003 template) in C# for a device with Windows Mobile 6.1. I need to use the camera of this device (photos, video); to do this work i tried using the CameraCaptureDialog class but it does not work for Pocket PC applications.
So, I documented on the internet and found that I probably refer to DirectShow API, but the problem is that I do not know where to start because I can't found a working/correct example.
My questions:
Is this the right way? Are there alternatives?
Where I can find a very good example that shows how to do this work?
You may try directshowbetcf: http://alexmogurenko.com/blog/directshownetcf/ if you really want to go with DirectShow and NetCF.
There's plenty of examples of directshow on the web. There is a site dedicated to converting the API over to C# which makes it a lot easier, maybe this was it http://directshownet.sourceforge.net/about.html. I struggled with DirectShow until I read the book "programming directshow" from microsoft press. About a third of that way through that book it all seemed incredibly easy and I was able to complete what I wanted. In the end it's a lot like referencing any library and using the classes from within that library. The added difficulty is that you need to add wrappers because they are all COM objects but that has been done for you.
This might be useful to you to understand the DirectShow technology. Basically gives a start to DirctShow and explains some of the important points. But its C++ not C#. Hope this help
Basic Video Capture
DirectShow is the video capture API in Windows Mobile 6. There is a Video Capture Filter there and all in all things are designed pretty much the same way they are in Windows.
The problem is that however that this is a native API, and not just in Windows Mobile. To develop in C# you need some bindings and they are missing. On desktop there is DirectShow.NET, which is a missing piece, but it does not seem to fit well for CE. Yet you still need to fill this gap in Windows Mobile.
To work it around you have a few ways, the first would be to go through DirectShow.NET and update it appropriately to start working on your device, strip parts missing in mobile OS etc. This would get you a twin for DS.NET but for mobile operating system.
Another option would be to do some C++ development and implement the minimal sufficient feature set in that domain, exposing the component via COM. Then you will reference this from managed code and things will get connected together. And another obvious option would be to use a third party solution which already does one of the mentioned above.
I have got a monitor with multitouch overlay on top of it. It works fine with Windows 7 but I want to write a multitouch application in C# for Windows XP which doesn't support touch feature out of the box. There is no documentation whatsoever and I emailed the manufacturer but never got a reply.
However the device works with Google Earth, which doesn't natively support multitouch, on Windows XP. So I think it generates many types of messages together i.e. WM_TOUCH for Windows 7, one for Google Earth COM API, and probably its own messages either in UDP or Windows message form. How can I trap all communications and learn the protocol?
OllyDbg is a very low-level debugger that allows you to see a lot of the messages going back and forth on the machine. I've seen it used to reverse-engineer a USB device driver's messages to figure out how to interact with an item.
I suspect that would be an excellent place to start. It should allow you to determine how the messages are being passed and, perhaps, start teasing apart their structure.
There are solutions like Tuio around that do not rely on Windows 7. Maybe a tuio (or alternative) implementation would make you life easier.
I've recently been developing on the Windows 7 platform for multitouch. I'm using UniTuio -- see http://xtuio.com You can look at my question I had to get it working. I'm also using a bridge for Windows 7 called Touch2TUIO, it seems to work quite well. If you need to make the mouse inactive see my question here: using windows 7 with unituio