Sdílet prostřednictvím


Stroke.Rotate Method

Rotates the Stroke object 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 Stroke 
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, each selected Stroke of an InkOverlay object is rotated clockwise 60 degrees. The rotation occurs around the center of the ink control.

Dim inkControl As Control = mInkOverlay.AttachedControl
' get the center of the ink control 
Dim centerPt As Point = New Point(inkControl.Width / 2, inkControl.Height / 2)
Using g As Graphics = inkControl.CreateGraphics()
    ' convert center point to ink space coordinates
    mInkOverlay.Renderer.PixelToInkSpace(g, centerPt)
End Using 
For Each S As Stroke In mInkOverlay.Selection
    S.Rotate(60.0F, centerPt)
Next
Control inkControl = mInkOverlay.AttachedControl;
// get the center of the ink control
Point centerPt = new Point(inkControl.Width / 2, inkControl.Height / 2);
using (Graphics g = inkControl.CreateGraphics())
{
    // convert center point to ink space coordinates
    mInkOverlay.Renderer.PixelToInkSpace(g, ref centerPt);
}
foreach (Stroke S in mInkOverlay.Selection)
{
    S.Rotate(60.0f, centerPt);
}

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

Stroke Class

Stroke Members

Microsoft.Ink Namespace

Stroke.Transform

Strokes.Rotate