Tuesday, February 15, 2011

Long Time No See - WriteableBitmapEx

I actually wanted to release the feature complete version 1.0 of the WriteableBitmapEx library after the previous release, but I've been very busy with other projects during the last year. That's why I decided to release version today. It contains many fixes, but also adds some features (see below). This version finally provides an official Windows Phone binary build, although the Windows Phone project was already available shortly after the first CTP was released. The zipped binaries can be downloaded from here. Please note that this package only contains the WriteableBitmapEx binaries for Silverlight and Windows Phone. All the samples can be found in the source code repository.

There's now also an unmaintained WPF branch of the WriteableBitmapEx library in the source code repository. It was contributed by Szymon Kobalczyk.
One might ask why it's not maintained. I started a poll and it seems that only 7 out of 16 need a WPF version of WriteableBitmapEx. The code is also quite bloated due to conditional compilation flags, which makes it harder to maintain in the future. That's why I decided not to integrate the WPF version. I just don't have enough time to maintain a hardly used version. I would rather point WPF users to Jeremiah Morrill's new project called DirectCanvas. It's in an early stage, but he's a great guy and working hard on it. I'm sure we'll see a great, GPU accelerated 2D drawing library for WPF in the future.

Feature list version
  • Fixed many bugs.
  • Added the Rotate method which rotates the bitmap in 90° steps clockwise and returns a new rotated WriteableBitmap.
  • Added a Flip method with support for FlipMode.Vertical and FlipMode.Horizontal.
  • Added a new Filter extension file with a convolution method and some kernel templates (Gaussian, Sharpen).
  • Added the GetBrightness method, which returns the brightness / luminance of the pixel at the x, y coordinate as byte.
  • Added the ColorKeying BlendMode.
  • Added boundary checks to the Crop() function to avoid OutOfRangeExceptions if the passed parameters are outside the boundaries of the original bitmap.
  • Optimized the DrawLine algorithm.
  • Optimized the Resize algorithms (NearestNeighbor is now 10x faster).
  • Optimized the Clear(Color) method.

Community FTW!
Thanks to the community for constantly reporting bugs and suggesting new features. You rock! That's why I love open source software.