InkOverlay.DefaultDrawingAttributes 属性

获取或设置默认 DrawingAttributes 对象,该对象指定在绘制和显示墨迹 时所使用的绘制属性。

命名空间:  Microsoft.Ink
程序集:  Microsoft.Ink(在 Microsoft.Ink.dll 中)

语法

声明
<BrowsableAttribute(False)> _
Public Property DefaultDrawingAttributes As DrawingAttributes
用法
Dim instance As InkOverlay
Dim value As DrawingAttributes

value = instance.DefaultDrawingAttributes

instance.DefaultDrawingAttributes = value
[BrowsableAttribute(false)]
public DrawingAttributes DefaultDrawingAttributes { get; set; }
[BrowsableAttribute(false)]
public:
property DrawingAttributes^ DefaultDrawingAttributes {
    DrawingAttributes^ get ();
    void set (DrawingAttributes^ value);
}
/** @property */
/** @attribute BrowsableAttribute(false) */
public DrawingAttributes get_DefaultDrawingAttributes()
/** @property */
/** @attribute BrowsableAttribute(false) */
public  void set_DefaultDrawingAttributes(DrawingAttributes value)
public function get DefaultDrawingAttributes () : DrawingAttributes
public function set DefaultDrawingAttributes (value : DrawingAttributes)

属性值

类型:Microsoft.Ink.DrawingAttributes
默认的 DrawingAttributes 对象,该对象指定在绘制和显示墨迹时所使用的绘制属性。

备注

使用此属性 (Property) 指定的 DrawingAttributes 绘制属性 (Attribute) 是分配给新光标的属性 (Attribute)。

默认绘制属性如下:

DrawingAttributes 属性

说明

AntiAliased

true

Color

Black

FitToCurve

false

Height

1(墨迹空间 单位)

IgnorePressure

false

PenTip

Ball

RasterOperation

CopyPen

Transparency

0(完全不透明)

Width

53(墨迹空间单位)

若要为新光标设置不同属性 (Attribute),请使用 Cursor 对象的 DrawingAttributes 属性 (Property)。

若要更改单个笔画的绘制属性 (Attribute),请使用 Stroke 对象的 DrawingAttributes 属性 (Property)。若要更改笔画集合的绘制属性 (Attribute),请调用 Strokes 集合的 ModifyDrawingAttributes 方法。

备注

DefaultDrawingAttributes 属性 (Property) 包含所有光标在未设置自己的 DrawingAttributes 属性时所使用的绘制属性 (Attribute)。例如,新 Cursor 对象使用 DefaultDrawingAttributes,而 DefaultDrawingAttributes 设置为 nullnull 引用(在 Visual Basic 中为 Nothing) 的旧 Cursor 对象也使用 DefaultDrawingAttributes

示例

此 C# 示例设置 InkOverlay 的一些默认绘制属性。

using Microsoft.Ink;
//. . .
InkOverlay theInkOverlay = new InkOverlay();

// Set the initial Width attribute to thin
theInkOverlay.DefaultDrawingAttributes.Width = 30;

// Set the initial Color attribute to Black
theInkOverlay.DefaultDrawingAttributes.Color = Color.Black;

// Set the initial RasterOperation attribute to CopyPen
theInkOverlay.DefaultDrawingAttributes.RasterOperation = RasterOperation.CopyPen;

// Set the initial Transparency attribute to opaque (0)
theInkOverlay.DefaultDrawingAttributes.Transparency = 0;

// Set the initial AntiAliased attribute to true
theInkOverlay.DefaultDrawingAttributes.AntiAliased = true;

此 Microsoft Visual Basic .NET 示例设置 InkOverlay 的一些默认绘制属性。

Imports Microsoft.Ink
'. . .
Dim theInkOverlay As New InkOverlay()

'Set the initial Width attribute to thin
theInkOverlay.DefaultDrawingAttributes.Width = 30

'Set the initial Color attribute to Black
theInkOverlay.DefaultDrawingAttributes.Color = Color.Black

'Set the initial RasterOperation attribute to CopyPen
theInkOverlay.DefaultDrawingAttributes.RasterOperation = RasterOperation.CopyPen

'Set the initial Transparency attribute to opaque (0)
theInkOverlay.DefaultDrawingAttributes.Transparency = 0

'Set the initial AntiAliased attribute to true
theInkOverlay.DefaultDrawingAttributes.AntiAliased = True

平台

Windows Vista

.NET Framework 和 .NET Compact Framework 并不是对每个平台的所有版本都提供支持。有关支持的版本的列表,请参见.NET Framework 系统要求

版本信息

.NET Framework

受以下版本支持:3.0

另请参见

参考

InkOverlay 类

InkOverlay 成员

Microsoft.Ink 命名空间

DrawingAttributes

Cursor.DrawingAttributes

Stroke.DrawingAttributes

Strokes.ModifyDrawingAttributes