#24 – Don’t Use Bitmaps in WPF Applications

Because WPF is able to scale your application based on the system DPI, you should avoid using bitmaps in your application.  Instead, you should render all controls, e.g. buttons on a toolbar, with vector graphics so that they can be scaled larger/smaller and still look correct.

The hardest part of this process will be finding vector-based graphical images to use in your application and then converting them to XAML so that you can use them in your WPF project.

Mike Swanson has written a plug-in for Adobe Illustrator that allows exporting vector-based images to XAML (which you can then import directly into a WPF project).  There’s also a good writeup explaining the process here.

Here’s an example, showing an image of the Earth that scales when the application window scales.

Advertisements

About Sean
Software developer in the Twin Cities area, passionate about software development and sailing.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: