Windows Dev Center

InkDrawingAttributes.Color | color property

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

Syntax


var color = inkDrawingAttributes.color;
inkDrawingAttributes.color = color;

Property value

Type: Color

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

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.

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.

Requirements (Windows 10 device family)

Device family

Universal

API contract

Windows.Foundation.UniversalApiContract, introduced version 1.0

Namespace

Windows.UI.Input.Inking
Windows::UI::Input::Inking [C++]

Metadata

Windows.Foundation.UniversalApiContract.winmd

Requirements (Windows 8.x and Windows Phone 8.x)

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Minimum supported phone

None supported

Namespace

Windows.UI.Input.Inking
Windows::UI::Input::Inking [C++]

Metadata

Windows.winmd

See also

InkDrawingAttributes
Pen and stylus interactions
Samples
Ink sample
Simple ink sample
Complex ink sample

 

 

Show:
© 2015 Microsoft