Feed on
Posts
Comments

Creating an ImageBrush in Blend has always been a multi-step process.  Blend 3 makes a few improvements in the steps necessary for creating a ImageBrush.  You can still use the traditional way if you desire.

Copy an Image to Clipboard

The first step in making making an ImageBrush is to copy a image to the clipboard.  For example, grab a picture from Word 2007 (see Figure 1).

image

Figure 1:  Copy picture in Word 2007.

Paste Image into Resource Dictionary in Blend 3

Open Blend 3 and select the Resources tab.  Choose the resource area where the ImageBrush will be defined.  In my example (see Figure 2) I will add it to  the Application.Resources within the App.xaml file.  Right-click the App.xaml file and choose Paste.

image

Figure 2: Paste into Resources tab.

Blend adds the following line (see Figure 3) of XAML to the App.xaml file.

image

Figure 3: ImageBrush added to XAML

Image Added to Project

Blend also adds the image to your project.  In my example the new image is named Image2.png (see Figure 4).

image

Figure 4:  Image automatically added to Project.

In this example I copied my image from Word. Since there was no filename available to Blend a default name was chosen. To retain the original image file name copy the picture from Windows Explorer.

Leave a Reply