Share via


SimpleShape.Scale Method

Scales the shape by the specified scaling factor.

Namespace:  Microsoft.VisualBasic.PowerPacks
Assembly:  Microsoft.VisualBasic.PowerPacks.Vs (in Microsoft.VisualBasic.PowerPacks.Vs.dll)

Syntax

'Declaration
Public Overrides Sub Scale ( _
    factor As SizeF _
)
public override void Scale(
    SizeF factor
)
public:
virtual void Scale(
    SizeF factor
) override
abstract Scale : 
        factor:SizeF -> unit 
override Scale : 
        factor:SizeF -> unit 
public override function Scale(
    factor : SizeF
)

Parameters

Remarks

The Scale method scales the shape by the specified scaling factor. This makes it larger or smaller by a percentage of its current size.

Examples

The following example demonstrates how to use the Scale method to scale an OvalShape control. This example requires that you have an OvalShape control named OvalShape1 on a form.

Private Sub OvalShape1_Click() Handles OvalShape1.Click
    Dim state As Boolean
    If state = False Then
        OvalShape1.Scale(New SizeF(2, 3))
        state = True
    Else
        OvalShape1.Scale(New SizeF(0.5, 0.333))
        state = False
    End If
End Sub
private void ovalShape1_Click(System.Object sender, System.EventArgs e)
{
    bool state = true;
    if (state == false)
    {
        ovalShape1.Scale(new SizeF(2, 3));
        state = true;
    }
    else
    {
        ovalShape1.Scale(new SizeF((float)0.5, ((float)0.333)));
        state = false;
    }
}

.NET Framework Security

See Also

Reference

SimpleShape Class

Microsoft.VisualBasic.PowerPacks Namespace

Other Resources

Introduction to the Line and Shape Controls (Visual Studio)

How to: Draw Lines with the LineShape Control (Visual Studio)

How to: Draw Shapes with the OvalShape and RectangleShape Controls (Visual Studio)