How to make GUI with kinect SDK Application SkeletonBasics-D2D? - c++

I have made a project using SkeletonBasics-D2D of Kinect XBOX 360 in C++ on gesture recognition. I have also used OpenCV in this project. Now I want to make GUI of this project for better representation. But I am not able to do this using Windows Form Application..I am new to Visual Studio 2010 and kinect.Kindly help me out of this problem.

Is there a reason you're not using WPF instead of a Windows Form Application? The Kinect for Microsoft SDK samples use WPFs due to its stronger capabilities with displaying/dealing with visual elements. The learning curve isn't that huge to go from Windows Form to WPF imo, and there are plenty of blogs that can help you get started or answer most questions you'll have to start off:
Here's a list of WPF blogs: http://blogs.msdn.com/b/jaimer/archive/2009/03/12/wpf-bloggers.aspx
My favorite is the 2000 things blog.
In WPF Kinect applications, there's typically an Image element in the .XAML side whose source is set to a WriteableBitmap property in the back-end code. On each Color Stream ready event (or any stream for that matter) you can write the new set of pixels to the WriteableBitmap and the WPF image element is instantly updated. I haven't tried using Windows Forms but I think it's a lot more work for a less-clean product.

Related

C++ Project Types for 3D Modelling and Game Control Program

I am a freshman programmer. I am trying to develop control software for a VR controller. It will use data from an array of rotary potentiometers to move a wireframe. The modeling software will apply textures and set the collision mask. These two programs are meant to be as fast as possible while running, integrate directly into games, and if possible exist as one program. I am using Visual Studio 2019 and was wondering which project type I should use.
Edit 1: I should clarify that this will be a game development tool. 1 part of it will only be used in the game and the other will be used to develop controls and create character skins and textures. The platform this will be used on is Windows.
I suggest you could try to use DirectX for 3D game development. You could create a windows desktop application or a UWP application.
To build DirectX desktop games, choose the “Game development with C++” workload under the “Mobile & Gaming” category.
To build a DirectX desktop app, you can start with the Win32 Project template in the New Project dialog, or download a Win32 game template, or download a sample from DirectX11 samples or DirectX12 samples as a starting point.
You could also build a DirectX game for UWP.
For more details I suggest you could refer to the link:https://devblogs.microsoft.com/cppblog/directx-game-development-with-c-in-visual-studio/
you should use Empty Project if you want to run your program in windows command prompt. if you want to run it like any other windows software with graphical interface then you need to use Windows Desktop Application.
according to me you should use empty project for this program.

Clipboard not found in UWP

I'm currently working on a project consisting of one program which tracks faces (which we got from https://github.com/Microsoft/Windows-universal-samples/tree/master/Samples/BasicFaceTracking), which is a Windows Universal App and our program, which is supposed to get the number of faces recognized and reacting appropriately.
I thought about copying the number of faces detected by the facetracking program to the clipboard and just reading it from the program.
The problem I have (which might actually be really simple) is that I can't seem to get to the Clipboard Class from within the UWP app.
Using OpenClipboard(NULL) or similar but I always get the error that the IDentifier is not found, no mater which header I include or not...
Can anyone give me a clue what to do? Or maybe a better alternative to transfer that one tiny int from one program to the other?
Thanks in advance.
janine
For UWP applications you should use Clipboard class.
OpenClipboard is an old Win32 API that is only available to desktop applications as mentioned at corresponding MSDN page:
Minimum supported client Windows 2000 Professional [desktop apps only]

Options for Camera Enumeration and HAL for UWP App (WPF/C++ CLI DLL)

I am creating video processing application. The application is written using a mixture of WPF and C++/CLI (a DLL). I currently connect to a machine vision camera and use a few functions in the camera's native driver e.g. I grab image data, I set hardware region-of-interest (roi).
I am currently using windows 10. The application is currently converted to UWP with the Desktop bridge.
What I would like is to use some sort of Hardware-Abstraction-Layer to connect to a range of cameras and to access image data and ROI functions (if available).
I was wondering if someone experienced in this could take me through the options (if they exist) and what are the main considerations.
When I web-search I get lost in the search results (for example, is Windows Media Foundation a possibility, if not why not etc.). Much of the web results are pretty old.
So really I would like someone to give me a few pointers so I can feel sure I am on the right track.
It is impossible use DirectShow cameras from UWP - in MSDN Win32 and COM for Universal Windows Platform (UWP) apps (multimedia). You can use DirectShow cameras from direct calling as COM object, but it is workable only on Desktop Windows with full supporting of COM. Universal Windows Platform (UWP) is a platform for programming on Desktop and Mobile - these are Windows with different architecture and UWP is an abstract layer for simple deploying on different platforms - it leads to limit functionality.

Skinning WinAPI Controls

If you've ever seen an application in the Adobe Creative Suite 5 (CS5), you may have noticed that it doesn't look like the native Windows GUI.. They have modified it to have a different look to it.
Where would someone begin to make an application that has a custom skin? CS5 uses the Adobe Source library for it's widget/control management, so I tried downloading and compiling the Adobe Source Library to see if I could make a nice skinned app like Photoshop CS5, but after finally getting it to compile and tested it, I realized the library was only for managing widgets and not skinning the GUI, like CS5 has.
Where would I begin to make a nice skinned program like Adobe Cs5 applications? Can anyone point me in the right direction?
Do I simply use the WM_PAINT Message from WinAPI and render my own widgets using openGL or something?
Use QT and QML. It doesn't have a steep learning curve. You define your GUI with JavaScript and add lots of effects and enjoy using PNGs in every single thing you can imagine. Then you do your application logic with C++. In fact you can do some fairly advanced things other than UI with QML but it's better to seperate concerns as always.
I use it at work for a product to be released. Overriding WM_PAINT is not the only way in Windows but I strongly recommend QT instead of Win32 API when it comes to custom drawn UI. At least to my experience, it is way easier than my adventures with Win32 API.
If you want to implement custom controls by yourself, you need to implement own WM_PAINT and draw with using GDI/GDI+. For toplevel windows and popups you can use Layered windows. But I think you can find a lot of professional custom controls over internet for reasonable price if you don't want to implement by yourself.
I think your choices re creating a modern skinned app are: QT or WPF (via C++/CLI).
If you have an existing Win32 API application and you do not want to rewrite it using a library that supports skinning you might want to have a look at Stardock DirectSkin.
If you decide to rewrite your application I would also recommend Qt. Guitar Pro 6 was rewritten using Qt, read more about their experience here.

Direct3D MDI Project: MFC or .NET?

I'm looking at a new project where both Native and Managed approaches sound like a good idea. This is a Windows desktop application which should support an MDI interface. The client area will make extensive use of Direct3D. The developers on the project are equally skilled on C#, C++/CLI and MFC.
MFC Advantages:
Doc/View Architecture
Most Direct3D online resources still use C++
Managed Code Advantages:
The .NET Framework
C#
What more can I add to the lists above? Don't flame this. Two lists. Just add to them.
Note: I have very good reasons (to do with the IDE and debugging) not to use mixed mode. So count that out.
Why not use both?
You can write the UI (forms) using C#/VB.NET and render the window using C++.
Basically all you need to do is pass the HWND (Window Handle) from the C# to the C++ and initialize the C++ using that value.
You can see an example on my blog: How-to Render managed (.NET) form using native DirectX
This doesn't directly add to either list, but the current "recommended" way to do 3D with .NET is using XNA - Managed DirectX is being deprecated.
Edit: Of course, WPF 3D is also an option! Forgot about that :}