Why you should develop systems in WPF, not WinForms
Part of a -part series of blogs

Posted by Andy Brown on 25 September 2012

You need a minimum screen resolution of about 700 pixels width to see our blogs. This is because they contain diagrams and tables which would not be viewable easily on a mobile phone or small laptop. Please use a larger tablet, notebook or desktop computer, or change your screen resolution settings.

10 - Drawing!

Windows Forms doesn't do drawing. WPF does - and how.

The main improvement with WPF is that everything is drawn using vector graphics, and so windows scale perfectly to any size.

This page gives an overview of some of the things that you can do using WPF.

Linear and Radial Gradient Brushes

You can colour the background of almost anything using either linear or radial gradients:

A radial and linear gradient

Examples of a radial and a linear gradient.

The linear gradient for the rectangle's border above segues gradually from red to violet, passing through all of the colours of the rainbow.

Image Brushes

You can also fill virtually anything with tiled, scaled or stretched images.  Here's an example:

Window with owl background

This border has been filled with repeated images of Olly the Owl.

 

Transitions

If the above isn't gimmicky enough, how about rotating, stretching or scaling parts of your window?

Some transformations

Some of the possible transformation effects.

I've included drawing last of all in my WPF benefits list because I think it's of marginal value for a business application - but it is fun!

This blog has 0 threads Add post