Using binary resources

Binary resources are just that: chunks of bytes that typically mean something to the application, such as image or font files. In this recipe, we'll cover the basics of adding and using a binary resource.

Getting ready

Make sure Visual Studio is up and running.

How to do it...

We'll create a simple application that uses an image file added as a binary resource:

  1. Create a new WPF Application named CH02.BinaryResources.
  2. Let's add a logical images folder to the project. Right-click the project node in Solution Explorer, and select Add | New Folder.
    How to do it...
  3. The folder is created as NewFolder1. Change its name to Images.
  4. Right-click on the newly ...

Get Windows Presentation Foundation 4.5 Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.