Pixa – the drawing tool

April 6, 2008

I’m happy to introduce you to Pixa!

Pixa is a drawing program that takes full advantage of WPF. While it looks like a typical raster editor it is actually a vector editor, every stroke you paint on Pixa is actually a Geometry object, this allows you to zoom and resize without affecting the drawing quality.

pixa3

I have launched a CodePlex project for Pixa, so you can download and play with it or contribute if you wish.

Please take into consideration that Pixa is a “PRE-ALPHA” version and is a long way from stable, I’m releasing it now so I can get feedback and share it with you (if you are interested in the code or your have an artistic soul ;) ).

I will talk in following posts about Pixa’s roadmap, features and explain how I implemented some of the main features.

I will be happy to know what you think.


Introduction to custom designers

January 17, 2008

Yogev Cohen is writing a series about creating your own custom designers, which is useful if your create control libraries or you are just intrigued about how this things work.

  1. Create your own Designer or Introduction To Custom Designers – Part 1- Designer
  2. Create your own Designer or Introduction To Custom Designers – Part 2- UI, Glyphs

And he had promise me to post about custom designer for WPF controls in the future!!


Debugging .NET Framework Source Code

January 17, 2008

On October last year Scott Guthrie blogged about Microsoft plans to release the .NET Framework Source Code to enable debugging support with Visual Studio 2008, well the moment is come and now you can browse and debug the source code of the following libraries:

.NET Base Class Libraries:
System, System.CodeDom, System.Collections
System.ComponentModel, System.Diagnostics
System.Drawing, System.Globalization, System.IO
System.Net, System.Reflection, System.Runtime
System.Security, System.Text, System.Threading, etc.

ASP.NET (System.Web, System.Web.Extensions)
Windows Forms (System.Windows.Forms)
Windows Presentation Foundation (System.Windows)
ADO.NET and XML (System.Data and System.Xml)

And soon the LINQ, WCF and the Workflow Foundation will be added.

You can find a detailed post by Shawn Burke that explains the exact steps on how to enable this.


RadioButton IsChecked Binding Problem in .NET 3.5 RTM

November 22, 2007

I have written two posts in the past about a bug in WPF’s RadioButton IsChecked property change notification.

On my first post I described the problem and in second post I proposed and demonstrated a workaround to the problem.

Now after the release of the .NET Frameworks 3.5, I checked it again and hoping that it was fixed, but unfortunately it wasn’t fixed 8O . But the same workarounds that I described in my previous post in this issue still do the jobs.


Microsoft Surface SDK

November 11, 2007

If you were wondering about how you can develop software for the Microsoft Surface….

Matt Davey pointed on his blog to the Surface team blog. The place, you may what to follow and catch up on the new developments of the Surface SDK.

From what I have read the SDK is divided in two layers, core and WPF. The core layer supports any .NET UI Framework that provides an hwnd and its XNA oriented, the WPF layer supports all the functionality of the core layer but it remains consistent with WPF’s methodology.

Also don’t miss to cool Hello world demo video!


Visual Studio 2008 and Framework 3.5 to RTM in November

November 5, 2007

At last for all of you that were waiting… the Visual Studio 2008 and the .Net Framework 3.5 are going to be released by the end of November 2007.

Read the press release for more info here.


.NET Framework 3.5 Types and Namespaces

November 5, 2007

Paul Andrew has posted an updated poster of the Commonly Used Types and Namespaces in .Net Framework 3.5, you can download it from here

NET35Poster

Enjoy!


ScrollViewer Frustrations Moments

November 1, 2007

Let say that you have a custom control that uses the command ApplicationCommands.Copy, and you expects that when you press Ctrl+C the command is executed, so far so good.

Now you want to wrap your control with ScrollViewer, that’s ok.

And you expect that the Ctrl+C will be handled, yes?

Well… NOOOOO!

Why! Because ScrollViewer overrides the OnKeyDown method and it’s preventing it to bubble any further.

Not an expected behavior in my opinion.

What to do? Set the Focusable property of the ScrollViewer to false, and it’s done.


Embedding Bitmaps inside XAML

October 8, 2007

I needed a type of BitmapSource that allows me to embed an image inside a XAML file. WPF has a number of derived BitmapSource classes, each one for its specialized task, one specific, BitmapImage, allows you to load images using XAML, but BitmapImage refer to external images in XAML files and does not embed images in a XAML file.

So I decided to create my own class to achieve the task.

What did I do?

  1. A BitmapSource derived class that expose a property with the bitmap info and can act as a reference to another BitmapSource.
  2. A container struct, BitmapInfo, to hold all the information needed to reconstruct the image, pixel array, size, format, etc.
  3. A TypeConverter that convert BitmapInfo to a serialized byte64 string and vice versa.

Using the EmbeddedBitmapSource is seamless as using any other derived BitmapSource class. For example:

Image myImage = new Image();

BitmapImage bmpImage = new BitmapImage( new Uri( “someimage.jpg” ) );

myImage.Source = new EmbeddedBitmapSource( bmpImage );

I included the sources with a sample application that let you save the image into a XAML file (the XAML file can be found after saving where the assembly is) and later to load it.

EmbeddedSample

On the upper right side is the original image and on the lower part of the window is the embedded image that was loaded from the XAML file.

Source code (VS2008 project) can be downloaded from here (Remember to change the .DOC extension to .ZIP)

By the way, I took the picture some year ago in Chile near Puerto Tranquilo. In Lake General Carrera are marble caves formations, called the Capilla de marmol and Catedral de marmol that were carved by water over time. One of those from a specific angle a dog’s head can be seen.


Huge News!! Microsoft is releasing part of the .NET Framework source code

October 3, 2007

Huge news!! Microsoft is releasing the Source Code for the .NET Framework Libraries, which includes ASP.NET, Windows Forms, WPF and much more.