RectangleExtensionsScaleBySizeDifference Method
Scale the size and position of the source Rectangle
by the difference of the specified sizes.
Namespace: DevCase.Extensions.RectangleExtensionsAssembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
[EditorBrowsableAttribute(EditorBrowsableState.Always)]
public static Rectangle ScaleBySizeDifference(
this Rectangle sender,
Size fromSize,
Size toSize
)
<ExtensionAttribute>
<EditorBrowsableAttribute(EditorBrowsableState.Always)>
Public Shared Function ScaleBySizeDifference (
sender As Rectangle,
fromSize As Size,
toSize As Size
) As Rectangle
Dim sender As Rectangle
Dim fromSize As Size
Dim toSize As Size
Dim returnValue As Rectangle
returnValue = sender.ScaleBySizeDifference(fromSize,
toSize)
public:
[ExtensionAttribute]
[EditorBrowsableAttribute(EditorBrowsableState::Always)]
static Rectangle ScaleBySizeDifference(
Rectangle sender,
Size fromSize,
Size toSize
)
[<ExtensionAttribute>]
[<EditorBrowsableAttribute(EditorBrowsableState.Always)>]
static member ScaleBySizeDifference :
sender : Rectangle *
fromSize : Size *
toSize : Size -> Rectangle
No code example is currently available or this language may not be supported.
- sender Rectangle
-
The source Rectangle.
- fromSize Size
-
The source Size.
- toSize Size
-
The target Size.
Rectangle
The resulting
Rectangle.
In Visual Basic and C#, you can call this method as an instance method on any object of type
Rectangle. When you use instance method syntax to call this method, omit the first parameter. For more information, see
Extension Methods (Visual Basic) or
Extension Methods (C# Programming Guide).
This is a code example.
No code example is currently available or this language may not be supported.
Dim oldSize As New Size(640, 480)
Dim oldRect As New Rectangle(New Point(100, 100), New Size(639, 479))
Dim newSize As New Size(800, 600)
Dim newRect As Rectangle = ScaleBySizeDifference(oldRect, oldSize, newSize)
Console.WriteLine(String.Format("oldRect: {0}", oldRect.ToString())) ' {X=100,Y=100,Width=639,Height=479}
Console.WriteLine(String.Format("newRect: {0}", newRect.ToString())) ' {X=125,Y=125,Width=798,Height=598}
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.