C#

TCD.Kinect

EDIT: If you’re interested in Skeleton tracking and calculating 3D stuff, take a look at TCD.Mathematics too^^ EDIT: There’s a WPF application that I once wrote, featuring SkeletonPainter3D: Kinect Sword. There’s a Youtube video of it (http://youtu.be/2j6GCd4M1bA) and that’s the source code: http://dl.dropbox.com/u/7813771/Blog/CodeSamples/KinectSword.zip   Hello there, I’ve created another UserControl, this time for Kinect and .NET 4.5, which hopefully has the potential to save you a lot of time. It can be used to draw three-dimensional Skeletons and explore the virtual space around them in real-time. A picture may be more appropriate: The control can be constructed in XAML: xmlns:kinect=”clr-namespace:TCD.Kinect.Controls;assembly=TCD.Kinect.Controls” <kinect:SkeletonPainter3D x:Name=”painter” Background=”Black” IsAnaglyphEnabled=”False” CameraFieldOfView=”70″ CameraPosition=”0,0.5,-1″ CameraLookAt=”0,0,2″ /> And populated with Skeletons using painter.Draw(skeletons), where skeletons is an Skeleton[] from inside the SkeletonFrameReady event. You can either get the TCD.Kinect package from NuGet, or refer to the sample implementation: http://code.msdn.microsoft.com/Implementation-of-f175b025 Let me know if you have any questions or suggestions, and by the way: SkeletonPainter3D has an experimental…

Software

TouchInjector

Hello world, Today I proudly present: TouchInjector TouchInjector is a Windows 8 Desktop application that translates TUIO into Windows Touch messages. It’s lightweight, easy to use and does not get in the way. No installation is required and with one click you can customize it to autorun with the system (on logon). As I frequently change my display settings, TouchInjector observes them and reacts accordingly. You can download it here. There are no further software requirements than a Windows 8 system. Just unzip, unblock and run it. (Allow access through the firewall and make sure that no other TUIO clients block the port.) Have fun! ~theCake

C#

Windows 8 TouchInjection with C#

The Windows 8 platform provides an API to inject touch events (WM_TOUCH..) via a C++ API. The API is relatively easy to use, but not available in C#, unless you do DllImport/PInvoke. I found this to be kind of tricky, but finally I succeeded to make a C# library that can be used to use the TouchInjection API from C#. You can find TCD.System.TouchInjection on NuGet, or have a look at the TouchInjection.cs file itself. You may notice that I renamed all the strucs, enums and classes to look nicer than their C++ counterparts. The IntelliSense descriptions are available for almost everything! (I got them from the documentation on msdn..) I’ve made a sample application for the MSDN Code Gallery as well. Here’s a small collection of useful resources regarding the TouchInjection API: C++ sample application C++ TouchInjection API walkthrough

C#

TCD.Controls

This is a summary and manual for all controls inside the TCD.Controls package. I’ll try to keep it updated. Windows 8 SilentTextBox – If AcceptsReturn=False and the user hits Enter normal TextBoxes make a ‘bling’ sound. SilentTextBox does not. HeaderedTextBox – A TextBox with a grey header above HeaderedTextBlock – A TextBlock with a grey header above; Automatically hides itself if the Text property is empty (unless AutoHide is set to False). LabeledProgressBar – a ProgressBar coupled with a TextBlock/Label; use it at the top of your page to indicate background progress (like the SystemTray.ProgressBar on Windows Phone) LayoutAwarePage – same as in all the samples Flyout – most recent post and how to use on Flyout SettingsContractWrapper – the easy way to integrate with the settings contract   Windows Phone CustomMessageBox – Async CustomMessageBox on Windows Phone ReverseAutocompletePopup – Making a reverse Autocomplete-TextBox on Windows Phone

Root

Q&A App

Hey, When my professor put a machine-readable quiz on his website, I made an app for my Phone to do the quiz.. Today I ported it to the desktop and I’d like to share it: Download Q&A App.zip It requires .NET Framework 4.0. To feed it with questions, you need a text file (preferable in UTF-8 encoding) that follows these simple rules: question-answer blocks are separated by one empty line question-lines begin with ‘Q: ’ answer-lines begin with ‘A: ‘ category-lines begin with ‘C: ‘ multiple Q/A/C-lines per block are allowed There’s a sample file in the *.zip. You can load a file from your computer, or from a remote location (eg. a textfile in a public dropbox folder). have fun!

C#

TCD.Device

Just another TCD namespace: TCD.Device. Its purpose is to contain additional namespaces that use features like Camera, GPS, Accelerometer, Compass.. Everything that has an effect on the App permissions the user sees on the Windows Phone or Windows 8 application. (Like ‘This app has access to your location, compass..’) TCD.Device.Camera CodeScannerPopup is another async control, specific to the Windows Phone platform, that can be used to scan for QR codes. (In theory other 2D-codes as well.) Usage: add the TCD.Device.Camera NuGet package add using directives for TCD.Device.Camera and TCD.Device.Camera.Barcodes in the calling method (eg. a Button.Click event) hide/show ApplicationBar, attach/remove BackKeyPress event Code sample: private async void Button_Click(object sender, RoutedEventArgs e) { CodeScannerPopup scp = new CodeScannerPopup(Microsoft.Phone.Shell.SystemTray.IsVisible, Format.ALL_1D); //important: hide ApplicationBar and handle BackKeyPress ApplicationBar.IsVisible = false; this.BackKeyPress += scp.HandleBackKeyPress; //now let’s go ScanResult r = await scp.ShowAsync(“BARCODE SCANNER”, “scan”); if (r != null) output.Text = string.Format(“{0}n{1}”, r.Text, r.Format.ToString()); //clean…

C#

TCD.Controls – Flyouts for XAML/C#

Hey there, Let’s start with the most important news: TCD.Controls is now available on NuGet (click here if you don’t know how this works, or why you want to use it) From now on, I won’t link *.zip packages with the sources anymore, because NuGet really make life easier. If you want access to the source files, just drop me an email There’s been one more or less important change to the Flyout control you should know about: It now has a property called “IsIgnoreLightDismissal”. To understand its purpose, imagine the following scenario (video below) You have a Button control that opens a FilePicker/FolderPicker, asking the user to select a File/Folder. This Button is hosted inside a Flyout control. Now when the user taps the Button, the Picker will popup, stealing the focus from your applications Window. Flyouts are required to hide on App-switch by the design guidelines, which is…

C#

Exploring NuGet

Since 5 hours now, I ‘m on NuGet and I’d like to share my first experiences. Why did I join NuGet? I joined NuGet, because it seems to be the most comfortable way to share libraries, containing XAML controls. Share them between my own projects, as well as with you. Previously I always had to include the project containing the controls in the solution I was working on, which was really annoying.. How can you use it? Let’s assume that you want to use a package in your project. All you need is the NuGet Package Manager Visual Studio extension. You can install it via Tools/Extensions and Updates. To use/reference a package from NuGet right-click on the references in the solution explorer and select ‘Manage NuGet Packages’. Then you can search for the package you desire (for example ‘TCD.Serialization’) and add it to your project. How do I use it?…

C#

Draw the Skeletons in two lines

Hello, Recently I was coding some Kinect stuff and wanted to draw the skeleton that the user can see what’s going on. In the Samples there’s some code for that, but it’s pretty annoying to copy/paste it in your own project every time, so I wrapped it up in a class called SkeletonPainter. To use it you just need an Image of either 640×480 or 320×240 and hand it over to the SkeletonPainter, along with the resolution and a background Brush of your choice: SkeletonPainter painter = new SkeletonPainter(skeletonImage, SkeletonPainterResolution.Resolution320x240, Brushes.White); Of course, you need to hand him the KinectSensor as well: painter.SwitchSensor(sensor); This way you can easily switch the KinectSensor while the painter is still active^ Have a try and tell me what you think =) Download TCD.Kinect.zip