WPF - creating (image) wall or prezi effect? - c#

I want to develop Windows WPF application using Kinect with great GUI/NUI. I've found really nice examples of user interfaces that could be even more admirable using Kinect device. For example: prezi effects - http://prezi.com/jipjiqvj6dsc/about-perspective/ one big wall and really nice zooming / moving. I was thinking about something similar for Metro UI too.
Do you know how to create those nice gui elements in the WPF? Or maybe you heard about good resources about this topic?

A good starting point is Josh Blake's upcomming book (you can get the MEAP preview now) and the "NaturalShow" sample app it includes. You can get that code at http://blakenui.codeplex.com/

I've found really nice project which includes solution for my problem: http://jarloo.com/code/projects/jot/
Nice discussion on stackoverflow: Pan & Zoom Image

Related

Displaying, overlaying and interpreting live video feed in WinForms

I am starting a new project to show live video in a Windows form from an attached web cam and overlay that video with windows controls (buttons etc). Additionally I would like to do some image correction to remove distortion on the fly and do some edge detection.
I'm confused as to which library might be best suited for this.
OpenCVSharp - Can handle the correction / detection, not sure if overlay / live feed is possible.
DirectShow/DirectShow.Net - Do I need to code filters up for the
overlay, how to handle edge detection?
AForge.net - It's been recommended but I'm not sure it is as capable
Does anyone have experience of these or other libs that might be suitable for access from .Net?
If you only want to work with the vision part then AForge.net is your best bet. I have used it in the past and it was pretty good for video/feed stuff. Don't expect to do something with your audio later on though since AForge.NET only supports Vision related stuff. Personally I wouldn't use DirectShow since that is pretty old and sometimes requires you to do some complex interop tricks to get what you want. If you want to go the DirectShow way at least use DirectShow.NET.
I believe you can accomplish that with OpenCVSharp and the instructions from transparent image overlay.

How to use XNA in WPF?

So... I want to make a game, and I want to write it in C#. In the past, I've made a mario clone using C++ and OpenGL. I quite like OpenGL, but I don't know how well it's supported inside C#/WPF. Also, it might be beneficial to use an actual game library? I guess XNA is the game library for C#, so maybe I'll invest a bit of time learning that.
However, I want to use WPF form controls for my level editor... is there any way that I can embed an XNA (DirectX?) window inside a WPF app?
Specifically, I don't need any buttons or things inside the XNA/DirectX widget, just around it, so no mixing required...just need to get a graphics widget in my WPF form.
Nick Gravelyn explains how to do it on his blog.
Although, if it's just for an editor, you may find using WinForms is easier and better supported.
First of all, you should ask this on gamedev.stackexchange.com. But I've seen a tutorial embedding XNA.
You should check this question and this page. They are on Windows Forms, but they'll help.
Also check this and this articles.
Keep in mind one thing. XNA is meant to be used for the whole game, integration would be useful on making level editors like you say, but not for a full game.
WPF uses DirectX, and you can do direct "interop" here is a codeProject article on the subject. Here is an article i dug up where the author is using win-forms and WPF controls in an XNA project. Might be worth a look for you.

Implement gestures on Microsoft Surface

Is there any tutorial or example available that shows how to implement a custom gesture into Microsoft Surface? After hours of googling I couldn't find any.
Unfortunately, the SDK does not even provide a framework to recognize gestures.
Im particularly intersted in gestures like a circle, or ? or x
Edit:
Is there any news here? Or any good hints how to just recognize a X over a UI element?
Unfortunately the Surface doesn't have any gesture framework. You just have to dive in and do it yourself by tracking Contacts as they move, appear, and disappear.
Generally it is not a good idea to creat complex gestures like that in your application because they are really hard for people to discover. That said, you could track the touches to create a polyline and then apply an algorithm like the one outlined at
http://faculty.washington.edu/wobbrock/pubs/uist-07.1.pdf
to distinguish the path in a set of gestures.
Another option, but maybe not what you want is to use the SurfaceInkCanvas and recognize the text entered there.
Thanks!
In the meantime I implemented my own gesture recognition tool following this documentation
If somebody is interested, I could share the source.

Learning WPF at work

There are some projects that could use WPF at work, for the sake of adopting new technologies.
But the problem is, I can't jump start WPF easily. I recognize the learning curve is steeper than Winforms. Though even with Winforms one can start doing UIs and programmatically customize them in a day.
So the problem is:
I don't have any resource to quickly learn the fundamentals of WPF at work. I can't read a book from cover to cover before I do the simplest of things.
Most tutorials on the net, just does things that excludes the fundamentals. i.e. they post partial xaml code I can't even put into my xaml code correctly (VS highlights them in red).
I can't justify using WPF over Winforms where there is no significant gain for prety much all projects I can think of. And the learning curve just makes things worse.
So I can't suggest my manager to use this tech over the traditional Winforms, but I want to.
Is there a guide or a tutorial on the net, or a video that explains the fundamentals of WPF so I can explore everything else on my own, except the more complicated tasks?
Fundamental of WPF video from Mix07.
Windows Client .NET get started section has lots of WPF Videos.
Channel 9 WPF content.
Windows Presentation Unleashed is a very good book.
MSDN content for WPF.
MSDN magazine articles on WPF.
Well, the basics are there. You can drag and drop controls onto a XAML surface in VS.NET 2008 just about as easily as you can with Windows Forms. Sure, there's the binding syntax stuff, but getting started isn't too bad.
But you DEFINITELY need to buy a good book on it. You don't need to have read it from cover to cover in order to get started. A decent book will have you up and running in a chapter or two, and you can take it from there. Just make sure that whatever book you buy, it was published after .NET 3.5 (and SP1 preferably) came out.
Also, understand WHY you want to use WPF. Is it just because it's new? Then you're right, that's not a good enough answer. WPF does have some big benefits though:
A powerful binding expression syntax that actually works
No need to repaint your own windows in response to WM_PAINT messages
_ (corrollary to the previous point) It's much easier to owner-draw and make your own controls
MS is spending a LOT of effort to actually develop it
MS is spending minimal effort on developing WinForms
If you need 2d/3d data visualisation WPF will pay by itself quickly and it's very evolving...
Personally I've got in that boat because all 3d hardware acceleration (opengl) wrapper in c# are dying so the solution for a maintened 3d looks like wpf or xna...
I'd suggest you get either expression blend or vs2010 beta ... vs2008 just don't speak wpf enough to help someone who doesn't know exactly what he's trying to do.

Good framework for a C# developer to use for visually stunning presentation layer

I am about to write a front end app, which will be used as a media center app. It will plug directly into a high definition TV. Essentially transforming my laptop into a media player. While this concept is not new, I want custom functionality, so this is why I am not reusing existing products.
I'm a C# developer, so the app should ideally be written in C#. And there is 1 other consideration, I need to accept input via the MCE Remote.
I was considering using Silverlight for this. Would you recommend this? Or any other recommendations for frameworks before I begin planning around this.
Thanks in advance.
This is the type of stuff that the Windows Presentation Foundation was meant for. You'll get a lot more access to the hardware than Silverlight would provide (I.E. that MCE remote you mentioned). You mark up your UI with vector graphics/XAML, and then perform the logic with C#.
EDIT: WPF also has support out of the box for animations which can make your UI a lot more interactive.
EDIT 2: Scott Hanselman has written a really cool application called BabySmash and posted the source online. It basically intercepts keyboard input and shows shapes and sounds on the computer. It's a good "child-proofing" method for your PC. The code could provide you with some insight into WPF and how to do the animations and interactivity that you're looking for.
Is this a desktop app? If so I would use WPF. Silverlight is a subset of WPF, so using WPF you could potentially do more.
Silverlight or WPF, if you want some extra power. Both have a similar programming model (with XAML and code-behind) so you might be able to start with Silverlight and move up to WPF if you need.
The VLC api might be useful for playing your media, someone has created a C# wrapper for it:
http://wiki.videolan.org/.Net_Interface_to_VLC
WPF is certainly the way to go, and for playing media check out the excellent WPF MediaKit: http://wpfmediakit.codeplex.com/ I've used it successfully in many projects.

Categories

Resources