InkDrawingAttributes.Color InkDrawingAttributes.Color InkDrawingAttributes.Color InkDrawingAttributes.Color InkDrawingAttributes.Color Property

Definition

Gets or sets a value that indicates the color of an InkStroke.

public : Color Color { get; set; }
Color Color();

void Color(Color color);
public Color Color { get; set; }
Public ReadWrite Property Color As Color
var color = inkDrawingAttributes.color;
inkDrawingAttributes.color = color;

Property Value

The ink color as an ARGB value. The default is black (0, 0, 0, 0).

Examples

The following example demonstrates how to set the Color property (color) of an InkStroke (stroke) using the Windows.UI.ColorHelper.FromArgb method.


var drawingAttributes = stroke.drawingAttributes;
drawingAttributes.color = 
     Windows.UI.ColorHelper.fromArgb(255, 255, 0, 0);
stroke.drawingAttributes = drawingAttributes;

The following alternative demonstrates how to set the Color property (color) of an InkStroke (stroke) without using the Windows.UI.ColorHelper.FromArgb method.

var drawingAttributes = stroke.drawingAttributes;
var color = drawingAttributes.color;
color.a = 255;
color.r = 255;
color.g = 0;
color.b = 0;
drawingAttributes.color = color;
stroke.drawingAttributes = drawingAttributes;

For the complete example, see Ink App sample.

Remarks

The value of Color is an ARGB value. However, the value of the transparency component (A, or alpha channel) is ignored and the InkStroke is rendered at full opacity.

The value of the transparency component is not discarded. It is stored with all other stroke data in the Ink Serialized Format (ISF) file when the InkStroke is saved.

See also