Using DrawingBrush to handle transparent backgrounds

With images it is sometimes difficult to see the difference between a white and transparent background. Using a DrawingBush in Tile mode can create the known checker background used in applications as Photoshop.

<DrawingBrush>
    <DrawingBrush.Drawing>
        <DrawingGroup>
            <GeometryDrawing Brush="White">
                <GeometryDrawing.Geometry>
                    <RectangleGeometry Rect="0,0,10,10" />
                </GeometryDrawing.Geometry>
            </GeometryDrawing>
            <GeometryDrawing Brush="LightGray">
                <GeometryDrawing.Geometry>
                    <GeometryGroup>
                        <RectangleGeometry Rect="0,0,5,5" />
                        <RectangleGeometry Rect="5,5,5,5" />
                    </GeometryGroup>
                </GeometryDrawing.Geometry>
            </GeometryDrawing>
        </DrawingGroup>
    </DrawingBrush.Drawing>
</DrawingBrush>

Which will give the following effect if used as the background property.

This entry was posted in Uncategorized and tagged . Bookmark the permalink.

2 Responses to Using DrawingBrush to handle transparent backgrounds

  1. bradlee says:

    me want xbox ripping info

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>