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. ❤
Showing posts with label windows store. Show all posts
Showing posts with label windows store. Show all posts
Wednesday, January 23, 2019
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.
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.
Labels:
.Net,
C#,
Computer graphics,
metro,
Silverlight,
uap,
Win8,
windows 10,
windows 8,
Windows Phone,
windows store,
WinRT,
Wp7Dev,
wp8dev,
wpdev,
wpf,
WriteableBitmap,
WriteableBitmapEx,
xaml
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
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
- ...
Labels:
.Net,
C#,
Computer graphics,
metro,
Silverlight,
uap,
Win8,
windows 10,
windows 8,
Windows Phone,
windows store,
WinRT,
Wp7Dev,
wp8dev,
wpdev,
wpf,
WriteableBitmap,
WriteableBitmapEx,
xaml
Friday, April 4, 2014
Content for the Modern Camera and Imaging Apps Build 2014 Session
I had a chance to give a presentation at Microsoft's largest developer conference //build 2014 about the great new capturing APIs. The session Modern Camera and Imaging Apps was given together with Jeff Day who's the Windows Camera API lead PM.
The session was recorded and available at Channel 9.
The slides can also be viewed / downloaded here.
The source code of the demos is available here.
The session was recorded and available at Channel 9.
The slides can also be viewed / downloaded here.
The source code of the demos is available here.
Friday, January 31, 2014
No Biggie - How to Query the Available Storage Size in WinRT
![]() |
| Tape drive photo by P. Hollenback |
Unfortunately there's no built-in way to check for the available free storage size / free disk space at those locations, although there are scenarios where that information can be essential, especially when dealing with removable devices. But no worries, the good old Win32 has it covered with the GetFreeDiskSpaceEx function and it can be used with Windows 8 and Windows Phone 8. In order to use it from managed code it just has to be called through P/Invoke or wrapped in a WinRT component which I prefer nowadays, therefore this post provides a short WinRT C++/Cx snippet.
I assume you know how to create a custom C++/Cx WinRT component with Visual Studio, if not go back to my previous blog post which shows just that.
How it works
- Open the generated precompiled header file pch.h of your WinRT component's Visual Studio project and add an include for windows.h:
// pch.h - Header for standard system include files. #pragma once #include <windows.h>
- Open the header file of your component and add the method declaration of GetAvailableBytes to your WinRT component which will internally use the GetFreeDiskSpaceEx, but only takes a path as string parameter and returns a WinRT uint64 (unsigned long) type with the available free space in bytes.
namespace MyNativeStuff { public ref class MyStorageExtensions sealed { public: uint64 GetAvailableBytes(Platform::String^ path); }; }
- Add the method implementation in the source file of the component (.cpp).
The GetDiskFreeSpaceEx function takes a pointer to an ULARGE_INTEGER which is an union from ancient times when compilers didn't support 64 bit types. Our method then returns the filled unsigned long QuadPart of it.
#include "pch.h" #include "MyNativeStuff.h" using namespace MyNativeStuff; using namespace Platform; uint64 MyStorageExtensions::GetAvailableBytes(Platform::String^ path) { ULARGE_INTEGER availableBytesToCaller; availableBytesToCaller.QuadPart = 0; GetDiskFreeSpaceEx(path->Data(), &availableBytesToCaller, NULL, NULL); return availableBytesToCaller.QuadPart; }
- You are now ready to use the component in your managed C# code.
var myNativeComponent = new MyNativeStuff.MyStorageExtensions(); // Create a folder in temp folder of the app and check the available free space var myTempFolder = await ApplicationData.Current.TemporaryFolder.CreateFolderAsync("test", CreationCollisionOption.OpenIfExists); var availableSpaceTempFolder = myNativeComponent.GetAvailableBytes(myTempFolder.Path); // Create a folder in videos lib and check the available free space var myVideoFolder = await KnownFolders.VideosLibrary.CreateFolderAsync("test", CreationCollisionOption.OpenIfExists); var availableSpaceVideoLib = myNativeComponent.GetAvailableBytes(myVideoFolder.Path);
Note, the GetFreeDiskSpaceEx works with any directory path the calling code is allowed to access.
Labels:
C++. Cx,
c++11,
Win8,
win81,
windev,
windows 8,
windows 8.1,
Windows Phone,
windows store,
winprt,
WinRT,
wp8,
wpdev
Monday, December 2, 2013
Easy Render! - WriteableBitmapEx now with Better Support for Win 8.1 RenderTargetBitmap

The lack of WriteableBitmap.Render in Windows WinRT 8.0 was quite an issue for many apps, but fortunately did WinRT 8.1 (re-)introduce the RenderTargetBitmap class which provides the functionality of rendering the visual tree of the UI to a bitmap. The new update of WriteableBitmapEx makes it even easier to use with a WriteableBitmap by introducing the FromPixelBuffer method.
WriteableBitmapEx is available for 4 platforms: Windows Phone 8 and 7, WPF, Silverlight and Windows Store WinRT .NET XAML 8 and 8.1.
You can download the binaries here or via the NuGet package. The packages contain the WriteableBitmapEx binaries. As usual all samples and the source code can be found in the repository.
How to use
The below code snippet shows how a part of the UI can be rendered into a WriteableBitmap via RenderTargetBitmap, how it can be modified and then finally presented back into the UI by using an Image control.
// Render some UI to a RenderTargetBitmap
var renderTargetBitmap = new RenderTargetBitmap();
await renderTargetBitmap.RenderAsync(Panel);
// Get the pixel buffer and copy it into a WriteableBitmap
var pixelBuffer = await renderTargetBitmap.GetPixelsAsync();
var width = renderTargetBitmap.PixelWidth;
var height = renderTargetBitmap.PixelHeight;
var wbmp = await new WriteableBitmap(1, 1).FromPixelBuffer(pixelBuffer, width, height);
// Modify the WriteableBitmap
wbmp.FillEllipse(10, 10, 256, 256, Colors.Salmon);
// ... More drawing including writeableBitmap.Blit(...) might go here
// Assign WriteableBitmap to an Image control to present it
ImgMirror.Source = wbmp;
Labels:
.Net,
C#,
Computer graphics,
metro,
Silverlight,
Win8,
windows 8,
Windows Phone,
windows store,
WinRT,
Wp7Dev,
wp8dev,
wpdev,
wpf,
WriteableBitmap,
WriteableBitmapEx,
xaml
Thursday, November 1, 2012
WACK ARM
If you are developing Windows 8 Store apps you should really test those on low-powered x86 and ARM devices. The difference to your high-end x64 developer machine can be dramatically, esp. if you use a non-default design.
Testing on ARM is important and Tim Heuer wrote a nice post which shows how to remotely deploy, debug and profile on ARM devices right from Visual Studio 2012. Another nice thing which performs a couple of automated tests is the Windows App Certification Kit (WACK). Unfortunately is the WACK tool for ARM hidden inside the Windows 8 SDK, but here's how to find it:
Testing on ARM is important and Tim Heuer wrote a nice post which shows how to remotely deploy, debug and profile on ARM devices right from Visual Studio 2012. Another nice thing which performs a couple of automated tests is the Windows App Certification Kit (WACK). Unfortunately is the WACK tool for ARM hidden inside the Windows 8 SDK, but here's how to find it:
- Download the Windows 8 SDK web setup from here and run it.
- Choose to download the SDK files for offline usage.
- On the "Select the features you want to download" screen it's enough if you only select the "Windows App Certification Kit" checkbox.
- After the download is finished, you will find an "Installers" subfolder in the download target folder.
- Copy the "Windows App Certification Kit arm-arm_en-us.msi" from the "Installers" folder to an USB key or SkyDrive.
- Open the "Windows App Certification Kit arm-arm_en-us.msi" on your ARM device and install the WACK on it.
- Search for "Windows App Cert Kit" on your ARM device using the Search Charm and run the WACK.
Labels:
ARM,
modern ui,
Store apps,
surface,
WACK,
windows 8,
windows store,
WinRT
Tuesday, October 30, 2012
Faster! - WriteableBitmapEx for Windows Phone 8 and WinRT Updated
The Windows Phone 8 SDK is now available and with that WriteableBitmapEx was updated too. The performance of the WinRT XAML version was also improved dramatically and an update is highly recommended.WriteableBitmapEx is available for 4 platforms: Windows Phone 8 and 7, WPF, Silverlight and Windows Store WinRT .NET XAML.
You can download the binaries here or via the NuGet package. The packages contain the WriteableBitmapEx binaries. As usual all samples and the source code can be found in the repository.
Labels:
.Net,
C#,
Computer graphics,
metro,
Silverlight,
Win8,
windows 8,
Windows Phone,
windows store,
WinRT,
Wp7Dev,
wp8dev,
wpdev,
wpf,
WriteableBitmap,
WriteableBitmapEx,
xaml
Wednesday, August 29, 2012
Update WriteableBitmapEx for WinRT RTM, WPF, Windows Phone and Silverlight
The RTM version of Windows 8 is now available and with that WriteableBitmapEx was updated too. WriteableBitmapEx is now available for 4 platforms: WPF, Silverlight, Silverlight for Windows Phone and Windows Store Style WinRT .NET.
You can download the binaries here or via the NuGet package. The packages contain the WriteableBitmapEx binaries. As usual all samples and the source code can be found in the repository.
Since the last WinRT release preview version, a couple of bugs were fixed and a new FromStrean method was added which loads an image stream into a WriteableBitmap. The project was also updated for the Windows 8 RTM version. Please read this blog post for more details about the WinRT version.
Labels:
.Net,
C#,
Computer graphics,
metro,
Silverlight,
Win8,
windows 8,
Windows Phone,
windows store,
WinRT,
Wp7Dev,
wpdev,
wpf,
WriteableBitmap,
WriteableBitmapEx,
xaml
Subscribe to:
Posts (Atom)




