Partager via


IXRImageBrush (Compact 2013)

3/28/2014

This class paints an area with an image.

Syntax

class IXRImageBrush : public IXRTileBrush

Inheritance Hierarchy

IXRDependencyObject

    IXRBrush

        IXRTileBrush

            IXRImageBrush

Methods

Method

Description

IXRImageBrush::AddImageFailedEventHandler

Attaches a delegate to the ImageFailed event for this image brush. When this image brush raises the ImageFailed event, this delegate is invoked.

IXRImageBrush::GetImageSource

Retrieves the image displayed by this image brush.

IXRImageBrush::RemoveImageFailedEventHandler

Removes a delegate from the ImageFailed event for this image brush.

IXRImageBrush::SetImageSource

Sets the image displayed by this image brush.

Thread Safety

Members of this class are thread-safe if you previously called IXRApplication::CreateHostFromXaml and supplied it with an XRWindowCreateParams structure that has AllowsMultipleThreadAccess set to true.

Remarks

An IXRImageBrush object paints an area with an IXRImageSource object. In XAML for Windows Embedded, IXRImageSource is a base class for IXRBitmapImage, which describes a bitmap graphic.

An IXRImageBrush object is a type of IXRTileBrush that defines its content as an image. You can control how the image is stretched, aligned, and tiled, which enables you to produce patterns and other effects.

One use for an image brush is to create a decorative effect for text in your application. To create this effect, supply an image brush as the fill of the text by using the IXRTextBlock::SetForeground method or the IXRGlyphs::SetFill method.

If you attempt to set an image that is in an invalid format or is specified to a Uniform Resource Identifier (URI) that cannot be resolved, the ImageFailed event is raised. You can create an event handler for this event, and attach a delegate for that handler by using the IXRImageBrush::AddImageFailedEventHandler method.

When you create a class instance, use an IXRImageBrushPtr smart pointer instead of a raw interface pointer. For more information, see XRPtr<Interface>.

You can also define an image brush in Microsoft Silverlight 3 XAML. For information about the differences between XAML in XAML for Windows Embedded and Silverlight 3, see Differences Between Microsoft Silverlight 3 and XAML for Windows Embedded. For more information about how to define this element in the source XAML for your application, see the ImageBrush Class on MSDN.

.NET Framework Equivalent

System.Windows.Media.ImageBrush

Requirements

Header

XamlRuntime.h

sysgen

SYSGEN_XAML_RUNTIME

See Also

Reference

Classes for Visual Appearance