Showing posts with label windows 10. Show all posts
Showing posts with label windows 10. Show all posts

Wednesday, January 23, 2019

My 10-Year Challenge - WriteableBitmapEx turns 10 with v1.6

It was 2009 when I started my first open source project and announced it with this unspectacular blog post. Back then it was developed with Visual Studio 2008 targeting Silverlight and hosted on CodePlex.
Many things have changed and tech comes and goes but during the last 10 years I always adapted, extended it, added bug fixes and reviewed/merged Pull Requests. Even after all the years WriteableBitmapEx is still quite popular, especially with Windows desktop WPF developers.

Version 1.6.2 of WriteableBitmapEx finally adds dedicated libs for UWP and an UWP sample. For WPF it now supports .NET Core, both the .NET Framework and .NET Core libs are part of the NuGet pack.

If you are using the source code and the VS solution directly, you can choose the .NET Framework 4.5 or .NET Core 3 as the target in the VS drop-down.



WriteableBitmapEx supports a variety of Windows platforms and versions.
WPF and Windows 10 Universal Windows Platform (UWP) are actively maintained.
Silverlight, Windows 8/8.1 WinRT, Windows Phone WinRT and Silverlight 7/8/8.1 are not maintained anymore but the latest stable libs are still part of the NuGet package.

You can download the latest via the updated NuGet package. The packages contain the WriteableBitmapEx binaries. All samples and the source code can be found in the GitHub repository.

A huge shout out and thank you to all the contributors, bug issuers and users of the library. ❤

Friday, May 5, 2017

Long time no hear - WriteableBitmapEx 1.5.1 is out

Even after all the years WriteableBitmapEx is still quite popular, especially with WPF developers and I always incorporate bug fixes and also accept Pull Requests if I get some time.
Many contributions were integrated and lots of bugs fixed. Among those are some nice additions like a clipped line drawing or a dotted line renderer.

WriteableBitmapEx supports a variety of Windows platforms and versions: WPF, Silverlight, Windows 10 Universal Windows Platform (UWP), Windows 8/8.1, Windows Phone WinRT and Silverlight 7/8/8.1.

You can download the latest via the updated NuGet package. The packages contain the WriteableBitmapEx binaries. All samples and the source code can be found in the GitHub repository.

A big thank you to all the contributors, bug reporters and users of the library who help with feedback.

Wednesday, September 23, 2015

We've Come a Long Way Baby - WriteableBitmapEx now on GitHub


The WriteableBitmapEx project is now 6 years old and times have changed since all began. It all started with Silverlight and more XAML flavors were added over time until all XAML flavors were supported including Windows Phone, WPF, WinRT Windows Store XAML, (Windows 10) UWP and still Silverlight.

The version control system and open source services landscape has changed as well and the CodePlex infrastructure has not been too reliable recently. That's why I finally took the time to move the WriteableBitmapEx source code from CodePlex' SVN bridge to Git and make it available on GitHubhttps://github.com/teichgraf/WriteableBitmapEx
Additionally was the open source license changed from Ms-PL to MIT which should simplify the usage as well. See the Codeplex Issue Tracker for a list of features that will be added in the future. Please use the GitHub Issues functionality to add new issues which are not already reported. Of course the latest binaries will continue to be distributed via NuGet.

Tuesday, May 12, 2015

Bridges connect the world - iOS and Android on Windows 10. What?

Bridge to Astoria, OR. Nov 2014
Photo from our road trip to Portland
At the //build 2015 conference Microsoft announced their development stories for Windows 10. This also includes bridges to reuse existing iOS, Android and other investments for Windows 10.
The keynote showed how an existing iOS game was ported to Windows 10 without much effort. The shown one-stop porting solutions for Android and iOS raised the concern why anyone should bother to develop natively for Windows 10 anymore and created quite some confusion and uncertainty in the Windows developer community. A few developers at //build were really worried about those announcements as some of their business is mainly porting iOS and Android apps to Windows Phone.

I think at the moment there's just too less knowledge to make decisions based on the announcements and assumptions floating around. There were two sessions at //build about Project Astoria for Android and Project Islandwood for iOS. Keep in mind both projects are in a alpha/beta stage and aren't publicly released at the moment so there's no public hands-on experience and independent in-depth analysis available yet. It's also worth noting that Project Astoria allows one to build Windows apps for phones but not for all Universal Windows Platforms at the moment. More information is expected during Summer 2015 and you could also try to sign up for an early access program for Astoria and Islandwood. There's also a good post by my friend Alan from AdDuplex. Peter Bright published a good Ars Technica article as well.

In my opinion there's one particular really good use case:
Share existing business logic across platforms and build the UI natively for the platform.
This way a common cross-platform app core is reused and the UI is built natively on top of that layer to provide the best UX. Porting an app completely might work for games with a custom UI and some simple apps, but advanced apps usually leverage too much platform-specific features for a one-stop port to work at all and a great app adapts to the UX of the platform.
Sharing core business logic is actually a common use case I see with our larger clients who want to bring their existing apps to Windows or Windows Phone. In the projects I've been involved over the last few years, the shared portion was usually implemented in C/C++ as it is still one of the best cross-platform options since most platforms support C/C++ in some way. Right now it is still quite an effort to get the custom C/C++ libs from other platforms adapted for Windows Phone compilation/linking, even with elevated API access rights. The cross-platform C++ Clang support in Visual Studio 2015 allows us to just recompile the Android or iOS C/C++ code and could help us a lot for such scenarios.
After writing this blog post I came across this excellent post by the Visual C++ team which describes just that. And this post which provides more details about the Visual Studio 2015 cross-platform C++ features.

As I see it, Xamarin will be the best choice for green field cross-platform projects to share as much code as possible and still provide the best UX. The new Visual Studio 2015 tooling for Windows 10 could help to make the reuse of existing iOS and Android business logic easier for Windows 10 when there's not a desire for a green field.

On the last day of //build I had a nice breakfast and roundtable with an executive of the Windows Dev Platform and of course we talked about the //build announcements. There was actually the same vision about the easier reuse of business logic. I think we made it clear that quite some confusion was created in the dev community around Islandwood, Astoria but we were told Microsoft will release more information to make the vision for those porting tools clearer.

In the end I think there's no need to be worried. Porting tools have never been a one-stop solution so I'm confident Islandwood and Astoria won't be the holy grail either. As usual a keynote also contains a good portion of marketing and software development is never that easy, so always consume such announcements with a grain of salt and wait for final decisions until the expected is delivered for real-world scenarios.
If those tools help us to make the porting of existing iOS and Android apps easier and the Store provides the apps which users are looking for, it's good for all Windows developers in the end.
It's just a matter of adapting to leverage the new tooling and helping clients to create great apps.

Don't Worry, Be Happy!

Friday, May 1, 2015

Magic Moments - Recap of the Holographic Academy

It's April the 30th afternoon and now 24 hours ago when I was lucky enough to be part of the first group of external developers worldwide who received a Holographic Academy training, so getting in-depth hands on HoloLens prototype hardware and actually deploying apps on it during a 4h course.
There was no NDA I had to sign so here's a quick recap. I actually double checked with some of the Microsoft mentors there that no NDA was in place.
They also released a video in the meantime where I have my 3 seconds of fame as well. And my friend Gregor published a German interview with me. I've also written an article for the German print magazine PC Magazin.

tl;dr
The HoloLens is the most impressive device I've ever tried. It's mind blowing. The Holographic academy workshop was fun and accessible for all kinds of developers.

Setting
This event was happening at a hotel nearby the //build conference center. The HoloLens team basically got a whole floor there. They had multiple security checks and lots of guards standing everywhere. I had to lock my stuff including my smartphone, so no photos or notes allowed but I got some nice HoloLens swag in exchange. After passing the 2nd or 3rd security checkpoint a team member measured my IPD (65.5 mm), then I passed another guard and finally was escorted into a fancy room with a few dozen attendees, lots of cameras, many HoloLens team members who helped the attendees as mentors, development PC setups and most importantly lots of HoloLens prototype devices (HL).

Hardware
The HL prototypes already looked very polished and have the computing units integrated. Still, the devices we tried had a clear laser printed label on it: "Prototype" and "Not FCC approved...".
After adjusting the HL to the head, it's quite comfortably to wear, not too heavy nor has any annoying fan noise. Unlike other devices does the HL also work well when the user is wearing glasses, so good for people like me.
So far there are only a few official pieces of information about the hardware available and no further information was shared at the event even though I kept asking the answer was always: "We are not ready to talk about that today." I heard that often but I was allowed to take an in-depth look at the devices. The following is based on my personal analysis so take it with a grain of salt.
There are at least 5 cameras on the front. 1 in the center and 2 on each side where 1 of the 2 is pointing to the side and the other one to the front. I suspect those 4 are the depth cameras. Covering 2 of those 4 with the hands still didn't break the recognition which was impressive. It was hard to judge the minimum and maximum distance it supports but I'd say it was around 0.5 - 5m or just like Kinect v2 in the range of 0.8 - 4m.
The projection screens for the left and right eye are not just flat 2D displays but actually kind of layered screens. I spotted 3 layers for each eye and it seemed like each layer is either for the red, green or blue component. These special screens are key for seamlessly merging the virtual objects into the real-world environment and that's the reason for calling the HoloLens a holographic device. The actual screens were a bit small on the HL prototypes they had available, so the field of view was narrower than expected but it's likely the next generation and consumer devices will improve this. The front also had a few tiny holes which I believe are microphones for the amazing speech recognition and sound analysis. For audio output there are small speakers in the headset band. They provide an immersive spatial sound I've never experienced before. More about that below.
The device is charged and connected to the PC for deploying via Micro USB. There seems to be a small special motherboard connector at the top of the front as well.

Walkthrough
The actual academy was using Unity to create a 3D scene. From within Unity a Visual Studio UAP solution was generated which was then deployed to the HL. Ctrl+F5 onto HoloLens! W00t!
I heard there are different tutorials for the academy. My group was doing the Origami tutorial which means the base was a 3D scene with various Origami paper-like 3D models or Holograms as the presenters called it.
The first chapter covered how to setup the device and running a little demo app where a virtual RC truck could be driven and pushed through the real-world room. On the floor, on the table, on the sofa, on humans, drive the virtual truck everywhere in the room!
The second chapter walked us through the process of getting the base Unity Origami scene deployed onto the device and exploring it from different angles in the room and collide with real-world objects.
The next step involved the addition of the Unity rigid body physics to the virtual 3D objects and adding a virtual indication where one is looking at while rotating the head. It was basically a torus which was projected onto the scenery on top of virtual and real-world objects. This is called Gaze. We also added an Air Tap gesture where one is tapping the index finger into the air. The gesture together with the raycasting of Gaze tells you what object in 3D space was selected and basically works like a spatial touch tap / mouse click interaction trigger. The Gaze is the mouse cursor movement in 3D space if you will and the air tap the mouse click. In the case of the Origami demo it triggered a physics action to let Origami paper balls fall down. All this dynamic functionality was implemented using Unity C# scripts.
After that, speech recognition was added into a C# script and it was very impressive. I just had to add an ordinary string like "Reset Scene" into a script without any pre-defined grammar and it just worked. And my HL device even worked only for my voice which means my HL did not react on the same voice commands another attendee was saying.
Later, spatial audio was added which means playing sounds in the 3D virtual environment for the 3D object interactions. This was mind blowing! These small speakers make the sound appear spatially from the scenery and around it. It's totally different than just headphones. You actually think other people hear the same in the room but they are not.
Then we added so called spatial mapping which means overlaying real-world objects with a virtual layer / net. In the academy we overlaid it just with wireframe polygons but trying it on the HL is a very impressive experience.
In the last chapter we removed parts of the real-world floor by overlaying it with a virtual 3D animation which showed a crack in the floor where Origami birds were flying in the underground. The screens of the HL are bright and saturated enough that it actually overlays the real-world without transparency and one could walk around and look from different angles into the underground. Mind blown again!

Further thoughts
There were more chapters / steps in-between for the Origami tutorial or in different order but I think I covered the keys of it above. I've never really used Unity before and I think it was a good choice by the HoloLens team to use Unity for this //build Holographic Academy as it's accessible for many developers who have never done any 3D computer graphics before and it quickly provides nice results. For myself I'd rather have preferred to get my hands on the underlying Direct3D surface and render my own 3D content to it. Honestly I was a bit bored by Unity so I added my own custom speech commands for more physics fun and explored the real HoloLens API with Visual Studio's Object Browser on the side and found some cool stuff in there.
It is great the HoloLens team lets developers get their hands on real device development less than 100 days after showing the first prototypes to the public. Kudos!

Final words
The HoloLens is the most impressive Augmented Reality experience I've ever tried. It's real, not just smoke and mirrors! There are so many innovations in it beside the seamlessly merging of virtual and real-world with the layered holographic screens: spatial audio, perfect speech recognition, spatial gesture recognition, low latency real-time mapping of the real-world environment and all that fully integrated into a single head mounted device without any external cables needed.
24h after attending the academy my mind is still blown and I can't wait to get my hands dirty on a dev device at home pushing it to the limits with the real SDK and Direct3D.
Exciting times!

Tuesday, March 31, 2015

Staying Alive! - WriteableBitmapEx 1.5 is out

After a couple of minor updates on top of version 1.0 which lead to 1.0.14, I'm happy to announce that WriteableBitmapEx 1.5 is now available.
Many contributions were integrated and lots of bugs fixed. Among those are some nice new color modifications and also long awaited DrawLine with variable thickness, pen support, better anti-aliased lines, Cohen-Sutherland line clipping, even-odd polygon filling and alpha-blended shape filling... Read the details at the end of this post or the release notes.

WriteableBitmapEx supports a variety of Windows platforms and versions: WPF, Silverlight, Windows 10 Universal App Platform (UAP), Windows 8/8.1, Windows Phone WinRT and Silverlight 7/8/8.1.


You can download the binaries here or via the NuGet package. The packages contain the WriteableBitmapEx binaries. All samples and the source code can be found in the repository.

A big thank you to all the contributors, bug reporters and users of the library who helped to shape this. You rock!

Changes
  • Added lots of contributions including DrawLine with variable thickness, penning, improved anti-aliasing and Wu's anti-aliasing algorithm
  • Added usage of CohenSutherland line clipping for DrawLineAa and DrawLine, etc.
  • Added support for alpha blended filled shapes and adapted the FillSample for WPF
  • Added FillPolygonsEvenOdd() which uses the even-odd algorithm to fill complex polygons with more than one closed outline like for the letter O
  • Added AdjustBrightness(), AdjustContrast() and AdjustGamma() methods
  • Added Gray() method which returns the gray scaled version the bitmap
  • Fixed regression issue with alpha blending for Blit for non-WinRT
  • Fixed bug in Blit Alpha code for WPF when source format is not pre-multiplied alpha
  • Fixed bug #21778 where FromStream for WPF needs to be called inside Init scope
  • Fixed issue with IndexOutOfRangeEx in DrawLine method
  • Fixed Invalidate for Silverlight BitmapContext.Dispose
  • Fixed many more reported issues
  • ...