Condividi tramite


Metodo Strokes.ScaleToRectangle

Aggiornamento: novembre 2007

Ridimensiona l'insieme Strokes affinché si adatti alla struttura Rectangle specificata.

Spazio dei nomi:  Microsoft.Ink
Assembly:  Microsoft.Ink (in Microsoft.Ink.dll)

Sintassi

'Dichiarazione
Public Sub ScaleToRectangle ( _
    scaleRectangle As Rectangle _
)
'Utilizzo
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
)

Parametri

Note

L'insieme Strokes viene ridimensionato e traslato in modo che corrisponda al riquadro dell'insieme Stroke del rettangolo.

Esempi

In questo esempio, un insieme Strokes di un oggetto InkOverlay viene ridimensionato per rientrare nella metà sinistra del riquadro originale. Innanzitutto, il rettangolo di delimitazione dell'insieme Strokes viene ottenuto chiamando il metodo GetBoundingBox utilizzando il valore CurveFit dell'enumerazione BoundingBoxMode per determinare i limiti del riquadro. Un nuovo rettangolo con metà della larghezza originale viene quindi creato e passato al metodo ScaleToRectangle.

' 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(BoundingBoxMode.CurveFit)
    Dim halfRectangle As Rectangle = _
            New Rectangle(bounds.Left, bounds.Top, bounds.Width / 2, bounds.Height)
    allStrokes.ScaleToRectangle(halfRectangle)
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(BoundingBoxMode.CurveFit);
    Rectangle halfRectangle = 
        new Rectangle(bounds.Left, bounds.Top, bounds.Width / 2, bounds.Height);
    allStrokes.ScaleToRectangle(halfRectangle);
}

Piattaforme

Windows Vista

.NET Framework e .NET Compact Framework non supportano tutte le versioni di ciascuna piattaforma. Per un elenco delle versioni supportate, vedere Requisiti di sistema di .NET Framework.

Informazioni sulla versione

.NET Framework

Supportato in: 3.0

Vedere anche

Riferimenti

Strokes Classe

Membri Strokes

Spazio dei nomi Microsoft.Ink

Stroke.ScaleToRectangle

Strokes.GetBoundingBox

Strokes.Scale

Strokes.Transform