InkDrawingAttributes.Color Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
public:
property Color Color { Color get(); void set(Color value); };
Color Color();
void Color(Color value);
public Color Color { get; set; }
var color = inkDrawingAttributes.color;
inkDrawingAttributes.color = color;
Public Property Color As 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;
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.
Applies to
See also
- Pen and stylus interactions
- Get started: Support ink in your UWP app
- Ink analysis sample (basic) (C#)
- Ink handwriting recognition sample (C#)
- Save and load ink strokes from an Ink Serialized Format (ISF) file
- Save and load ink strokes from the clipboard
- Ink toolbar location and orientation sample (basic)
- Ink toolbar location and orientation sample (dynamic)
- Coloring book sample
- Family notes sample
- Inking sample (JavaScript)
- Simple inking sample (C#/C++)
- Complex inking sample (C++)
- Ink analysis sample