RectangleStylusShape Konstruktorer
Definition
Viktigt
En del information gäller för förhandsversionen av en produkt och kan komma att ändras avsevärt innan produkten blir allmänt tillgänglig. Microsoft lämnar inga garantier, uttryckliga eller underförstådda, avseende informationen som visas här.
Initierar en ny instans av RectangleStylusShape klassen.
Överlagringar
| Name | Description |
|---|---|
| RectangleStylusShape(Double, Double) |
Initierar en ny instans av RectangleStylusShape klassen med angiven bredd och höjd. |
| RectangleStylusShape(Double, Double, Double) |
Initierar en ny instans av RectangleStylusShape klassen med angiven bredd, höjd och vinkel. |
RectangleStylusShape(Double, Double)
Initierar en ny instans av RectangleStylusShape klassen med angiven bredd och höjd.
public:
RectangleStylusShape(double width, double height);
public RectangleStylusShape(double width, double height);
new System.Windows.Ink.RectangleStylusShape : double * double -> System.Windows.Ink.RectangleStylusShape
Public Sub New (width As Double, height As Double)
Parametrar
- width
- Double
Bredden på pennans form.
- height
- Double
Höjden på pennans form.
Exempel
I följande exempel visas hur du använder en RectangleStylusShape för att utföra träfftestning på en StrokeCollection. Det här exemplet förutsätter att det finns en InkPresenter som heter presenter.
private void HitTestWithEraser(Point[] points)
{
RectangleStylusShape eraser = new RectangleStylusShape(3, 3, 0);
StrokeCollection strokes = presenter.Strokes.HitTest(points, eraser);
foreach (Stroke s in strokes)
{
s.DrawingAttributes.Color = Colors.Purple;
}
}
Private Sub HitTestWithEraser(ByVal points() As Point)
Dim eraser As RectangleStylusShape = New RectangleStylusShape(3, 3, 0)
Dim strokes As StrokeCollection = presenter.Strokes.HitTest(points, eraser)
Dim s As Stroke
For Each s In strokes
s.DrawingAttributes.Color = Colors.Purple
Next
End Sub
Gäller för
RectangleStylusShape(Double, Double, Double)
Initierar en ny instans av RectangleStylusShape klassen med angiven bredd, höjd och vinkel.
public:
RectangleStylusShape(double width, double height, double rotation);
public RectangleStylusShape(double width, double height, double rotation);
new System.Windows.Ink.RectangleStylusShape : double * double * double -> System.Windows.Ink.RectangleStylusShape
Public Sub New (width As Double, height As Double, rotation As Double)
Parametrar
- width
- Double
Bredden på pennans form.
- height
- Double
Höjden på pennans form.
- rotation
- Double
Vinkeln på pennans form.
Exempel
I följande exempel visas hur du använder en RectangleStylusShape för att utföra träfftestning på en StrokeCollection. Det här exemplet förutsätter att det finns en InkPresenter som heter presenter.
private void HitTestWithEraser(Point[] points)
{
RectangleStylusShape eraser = new RectangleStylusShape(3, 3, 0);
StrokeCollection strokes = presenter.Strokes.HitTest(points, eraser);
foreach (Stroke s in strokes)
{
s.DrawingAttributes.Color = Colors.Purple;
}
}
Private Sub HitTestWithEraser(ByVal points() As Point)
Dim eraser As RectangleStylusShape = New RectangleStylusShape(3, 3, 0)
Dim strokes As StrokeCollection = presenter.Strokes.HitTest(points, eraser)
Dim s As Stroke
For Each s In strokes
s.DrawingAttributes.Color = Colors.Purple
Next
End Sub