Sdílet prostřednictvím


Strokes.Rotate Method

Rotates the Strokes collection around a center point.

Namespace:  Microsoft.Ink
Assembly:  Microsoft.Ink (in Microsoft.Ink.dll)

Syntax

'Declaration
Public Sub Rotate ( _
    degrees As Single, _
    point As Point _
)
'Usage
Dim instance As Strokes 
Dim degrees As Single 
Dim point As Point

instance.Rotate(degrees, point)
public void Rotate(
    float degrees,
    Point point
)
public:
void Rotate(
    float degrees, 
    Point point
)
public function Rotate(
    degrees : float, 
    point : Point
)

Parameters

  • degrees
    Type: System.Single

    The degrees by which to rotate clockwise.

Examples

In this example, a Strokes collection of an InkOverlay,object is rotated clockwise 60 degrees. The rotation occurs around the center of the bounding box of the Strokes collection.

' Access to the Strokes property returns a copy of the Strokes object. 
' This copy must be implicitly (via using statement) or explicitly 
' disposed of in order to avoid a memory leak. 
Using allStrokes As Strokes = mInkOverlay.Ink.Strokes
    Dim bounds As Rectangle = allStrokes.GetBoundingBox()
    ' create a point at the center of bounding box 
    Dim center As Point = New Point(bounds.Left + (bounds.Width / 2), bounds.Top + (bounds.Height / 2))
    allStrokes.Rotate(60.0F, center)
End Using
// Access to the Strokes property returns a copy of the Strokes object. 
// This copy must be implicitly (via using statement) or explicitly 
// disposed of in order to avoid a memory leak. 
using (Strokes allStrokes = mInkOverlay.Ink.Strokes)
{
    Rectangle bounds = allStrokes.GetBoundingBox();
    // create a point at the center of bounding box
    Point center = new Point(bounds.Left+(bounds.Width/2), bounds.Top+(bounds.Height/2));
    allStrokes.Rotate(60.0f, center);
}

Platforms

Windows 7, Windows Vista, Windows Server 2008 R2, Windows Server 2008

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Version Information

.NET Framework

Supported in: 3.0

See Also

Reference

Strokes Class

Strokes Members

Microsoft.Ink Namespace

Strokes.Transform

Stroke.Rotate