Click to Rate and Give Feedback
MSDN
MSDN Library
.NET Development
.NET Framework 3.5
Strokes Class
Strokes Methods
 Rotate Method
Collapse All/Expand All Collapse All
This page is specific to
Microsoft Visual Studio 2008/.NET Framework 3.5

Other versions are also available for the following:
.NET Framework Class Library
Strokes..::.Rotate Method

Rotates the Strokes collection around a center point.

Namespace:  Microsoft.Ink
Assembly:  Microsoft.Ink (in Microsoft.Ink.dll)
Visual Basic (Declaration)
Public Sub Rotate ( _
    degrees As Single, _
    point As Point _
)
Visual Basic (Usage)
Dim instance As Strokes
Dim degrees As Single
Dim point As Point

instance.Rotate(degrees, point)
C#
public void Rotate(
    float degrees,
    Point point
)
Visual C++
public:
void Rotate(
    float degrees, 
    Point point
)
JScript
public function Rotate(
    degrees : float, 
    point : Point
)

Parameters

degrees
Type: System..::.Single
The degrees by which to rotate clockwise.
point
Type: System.Drawing..::.Point
The point—in ink space coordinates—around which to rotate.

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.

Visual Basic
' 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
C#
// 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);
}

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.

.NET Framework

Supported in: 3.0
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks | Privacy Statement
Page view tracker