다음을 통해 공유


Stroke 생성자

정의

Stroke 클래스의 새 인스턴스를 초기화합니다.

오버로드

Stroke(StylusPointCollection)

Stroke 클래스의 새 인스턴스를 초기화합니다.

Stroke(StylusPointCollection, DrawingAttributes)

Stroke 클래스의 새 인스턴스를 초기화합니다.

Stroke(StylusPointCollection)

Stroke 클래스의 새 인스턴스를 초기화합니다.

public:
 Stroke(System::Windows::Input::StylusPointCollection ^ stylusPoints);
public Stroke (System.Windows.Input.StylusPointCollection stylusPoints);
new System.Windows.Ink.Stroke : System.Windows.Input.StylusPointCollection -> System.Windows.Ink.Stroke
Public Sub New (stylusPoints As StylusPointCollection)

매개 변수

stylusPoints
StylusPointCollection

StylusPointCollection를 나타내는 Stroke입니다.

예외

stylusPoints이(가) null인 경우

stylusPoints가 비어 있는 경우

예제

다음 예제에서는 만드는 방법을 보여 줍니다.는 Stroke 에서 StylusPointCollectionDrawingAttributes 개체입니다. 이 예제에서는 있다고 가정를 InkPresenter 호출 myInkPresenter합니다.

DrawingAttributes drawingAttributes1 = new DrawingAttributes();
drawingAttributes1.Color = Colors.Green;

StylusPoint stylusPoint1 = new StylusPoint(100, 100);
StylusPoint stylusPoint2 = new StylusPoint(100, 200);
StylusPoint stylusPoint3 = new StylusPoint(200, 200);
StylusPoint stylusPoint4 = new StylusPoint(200, 100);
StylusPoint stylusPoint5 = new StylusPoint(100, 100);

StylusPointCollection points = new StylusPointCollection(
    new StylusPoint[] { stylusPoint1, stylusPoint2, stylusPoint3, 
                        stylusPoint4, stylusPoint5 });

Stroke newStroke = new Stroke(points, drawingAttributes1);

myInkPresenter.Strokes.Add(newStroke);
Dim drawingAttributes1 As New DrawingAttributes()
drawingAttributes1.Color = Colors.Green

Dim stylusPoint1 As StylusPoint = New StylusPoint(100, 100)
Dim stylusPoint2 As StylusPoint = New StylusPoint(100, 200)
Dim stylusPoint3 As StylusPoint = New StylusPoint(200, 200)
Dim stylusPoint4 As StylusPoint = New StylusPoint(200, 100)
Dim stylusPoint5 As StylusPoint = New StylusPoint(100, 100)

Dim points() As StylusPoint = {stylusPoint1, stylusPoint2, _
                    stylusPoint3, stylusPoint4, stylusPoint1}

Dim pointCollection As New StylusPointCollection(points)

Dim NewStroke As Stroke = New Stroke(pointCollection, drawingAttributes1)

myInkPresenter.Strokes.Add(NewStroke)

적용 대상

Stroke(StylusPointCollection, DrawingAttributes)

Stroke 클래스의 새 인스턴스를 초기화합니다.

public:
 Stroke(System::Windows::Input::StylusPointCollection ^ stylusPoints, System::Windows::Ink::DrawingAttributes ^ drawingAttributes);
public Stroke (System.Windows.Input.StylusPointCollection stylusPoints, System.Windows.Ink.DrawingAttributes drawingAttributes);
new System.Windows.Ink.Stroke : System.Windows.Input.StylusPointCollection * System.Windows.Ink.DrawingAttributes -> System.Windows.Ink.Stroke
Public Sub New (stylusPoints As StylusPointCollection, drawingAttributes As DrawingAttributes)

매개 변수

stylusPoints
StylusPointCollection

StylusPointCollection를 나타내는 Stroke입니다.

drawingAttributes
DrawingAttributes

DrawingAttributes의 모양을 지정하는 Stroke 개체입니다.

예외

stylusPoints이(가) null인 경우

또는 drawingAtrributes이(가) null인 경우

stylusPoints가 비어 있는 경우

예제

다음 예제에서는 만드는 방법을 보여 줍니다.는 Stroke 에서 StylusPointCollectionDrawingAttributes 개체입니다. 이 예제에서는 있다고 가정를 InkPresenter 호출 myInkPresenter합니다.

DrawingAttributes drawingAttributes1 = new DrawingAttributes();
drawingAttributes1.Color = Colors.Green;

StylusPoint stylusPoint1 = new StylusPoint(100, 100);
StylusPoint stylusPoint2 = new StylusPoint(100, 200);
StylusPoint stylusPoint3 = new StylusPoint(200, 200);
StylusPoint stylusPoint4 = new StylusPoint(200, 100);
StylusPoint stylusPoint5 = new StylusPoint(100, 100);

StylusPointCollection points = new StylusPointCollection(
    new StylusPoint[] { stylusPoint1, stylusPoint2, stylusPoint3, 
                        stylusPoint4, stylusPoint5 });

Stroke newStroke = new Stroke(points, drawingAttributes1);

myInkPresenter.Strokes.Add(newStroke);
Dim drawingAttributes1 As New DrawingAttributes()
drawingAttributes1.Color = Colors.Green

Dim stylusPoint1 As StylusPoint = New StylusPoint(100, 100)
Dim stylusPoint2 As StylusPoint = New StylusPoint(100, 200)
Dim stylusPoint3 As StylusPoint = New StylusPoint(200, 200)
Dim stylusPoint4 As StylusPoint = New StylusPoint(200, 100)
Dim stylusPoint5 As StylusPoint = New StylusPoint(100, 100)

Dim points() As StylusPoint = {stylusPoint1, stylusPoint2, _
                    stylusPoint3, stylusPoint4, stylusPoint1}

Dim pointCollection As New StylusPointCollection(points)

Dim NewStroke As Stroke = New Stroke(pointCollection, drawingAttributes1)

myInkPresenter.Strokes.Add(NewStroke)

적용 대상