Strokes.ScaleToRectangle Method
Scales the Strokes collection to fit in the specified Rectangle structure.
Namespace: Microsoft.Ink
Assembly: Microsoft.Ink (in microsoft.ink.dll)
Syntax
'Declaration
Public Sub ScaleToRectangle ( _
scaleRectangle As Rectangle _
)
'Usage
Dim instance As Strokes
Dim scaleRectangle As Rectangle
instance.ScaleToRectangle(scaleRectangle)
public void ScaleToRectangle (
Rectangle scaleRectangle
)
public:
void ScaleToRectangle (
Rectangle scaleRectangle
)
public void ScaleToRectangle (
Rectangle scaleRectangle
)
public function ScaleToRectangle (
scaleRectangle : Rectangle
)
Not applicable.
Parameters
- scaleRectangle
The Rectangle structure, in ink space coordinates, to which the Strokes collection is scaled.
Remarks
The Strokes collection is scaled and translated to match the Stroke collection's bounding box to the rectangle.
Example
This C# example scales the ink to fit in the left half of the original bounding box. The strokes are taken from an InkOverlay object, theInkOverlay
, and a Rectangle structure, halfRectangle
, is created for the left half of the bounding box. The ScaleToRectangle method is then called, passing in halfRectangle
as the scaleRectangle parameter.
Rectangle inkBounds = inkOverlay.Ink.Strokes.GetBoundingBox();
Rectangle halfRectangle = new Rectangle(inkBounds.Left,
inkBounds.Top, inkBounds.Width / 2, inkBounds.Height);
inkOverlay.Ink.Strokes.ScaleToRectangle(halfRectangle);
This Microsoft Visual Basic.NET example scales the ink to fit in the left half of the original bounding box. The strokes are taken from an InkOverlay object, theInkOverlay
, and a Rectangle structure, halfRectangle
, is created for the left half of the bounding box. The ScaleToRectangle method is then called, passing in halfRectangle
as the scaleRectangle parameter.
Dim inkBounds As Rectangle = inkOverlay.Ink.Strokes.GetBoundingBox()
Dim halfRectangle As New Rectangle(inkBounds.Left, _
inkBounds.Top, inkBounds.Width / 2, inkBounds.Height)
inkOverlay.Ink.Strokes.ScaleToRectangle(halfRectangle)
Platforms
Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.
Version Information
.NET Framework
Supported in: 3.0
See Also
Reference
Strokes Class
Strokes Members
Microsoft.Ink Namespace
Stroke.ScaleToRectangle
Microsoft.Ink.Strokes.GetBoundingBox
Strokes.Scale
Microsoft.Ink.Strokes.Transform