DrawingAttributes.Color Property

Gets or sets the color that is used to draw a Stroke.

Namespace:  System.Windows.Ink
Assembly:  System.Windows (in System.Windows.dll)

public Color Color { get; set; }
<DrawingAttributes Color="colorString"/>

XAML Values

colorString

A Color expressed as an attribute string. This can be a named color, an RGB value, or an ScRGB value. RGB or ScRGB may also specify alpha information. See Color.

Property Value

Type: System.Windows.Media.Color
The color that is used to draw a Stroke. The default is Black.

For information about the colors that you can use, see Color.

The following code example demonstrates how to set the Color property. This is part of a larger example available in DrawingAttributes class overview.


//Set drawing attributes to simulate a highlighter
private void BtHighlighter_Click(object sender, EventArgs e)
{
    MyDA.Width = 25;
    MyDA.Height = 5;
    MyDA.Color = Colors.Yellow;
    MyDA.OutlineColor = Colors.Yellow;
}


Silverlight

Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

Community Additions

ADD
Show: