ineffable p
ineffable p

Reputation: 1189

Gradient brush like heap

It looks like a simple question but I am struggling to produce as in image for background color of grid.

My manager needs same as it is.

So far I have tried this, but not getting background exactly same as below image with heap behind.

<Window.Resources>
    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0" x:Key="Background">
        <GradientStop Color="#FBDEE0" Offset="0.5"/>
        <GradientStop Color="#F4B8B8 " Offset="0.570"/>
        <GradientStop Color="#F4B8B8 " Offset="1"/>
    </LinearGradientBrush>
</Window.Resources>
<Grid Background="{StaticResource Background}">

</Grid>

enter image description here

Upvotes: 1

Views: 80

Answers (1)

Gayot Fow
Gayot Fow

Reputation: 8792

The tool for the 'heap' is a radial gradient brush with very hard colour stops...

This declaration...

        <RadialGradientBrush GradientOrigin="0.5, 1.12" RadiusX="1.5" RadiusY="1" MappingMode="RelativeToBoundingBox" SpreadMethod="Pad" >
            <GradientStop Offset="0" Color="IndianRed"/>
            <GradientStop Offset="0.49" Color="IndianRed"/>
            <GradientStop Offset="0.5" Color="Pink"/>
        </RadialGradientBrush>

...will produce an effect like this...

enter image description here

You can replace the colours with your own to produce an exact replica of the spec...

The docs for this type of brush are at http://msdn.microsoft.com/en-us/library/system.windows.media.radialgradientbrush.aspx

Upvotes: 3

Related Questions