User32SubtractRect(Rectangle, Rectangle, Rectangle) Method
Determines the coordinates of a
Rectangle
formed by subtracting one
Rectangle from another.
The function only subtracts the
Rectangle specified by
refSrcRect2
from the
Rectangle specified by
refSrcRect1
when the rectangles intersect completely in either the x- or y- direction.
For example, if
refSrcRect1 has the coordinates {10, 10, 100, 100}
and
refSrcRect2 has the coordinates {50, 50, 150, 150},
the function sets the coordinates of the
Rectangle pointed to
by
refDstRect to {10, 10, 100, 100}.
If
refSrcRect1 has the coordinates {10, 10, 100, 100}
and
refSrcRect2 has the coordinates {50, 10, 150, 150},
however, the function sets the coordinates of the
Rectangle pointed to
by
refDstRect to {10, 10, 50, 100}.
In other words, the resulting
Rectangle is the bounding box of the geometric difference.
Namespace: DevCase.Win32.NativeMethodsAssembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
[DllImportAttribute("User32.dll")]
public static bool SubtractRect(
out Rectangle refDstRect,
in Rectangle refSrcRect1,
in Rectangle refSrcRect2
)
<DllImportAttribute("User32.dll">]
Public Shared Function SubtractRect (
<OutAttribute> ByRef refDstRect As Rectangle,
ByRef refSrcRect1 As Rectangle,
ByRef refSrcRect2 As Rectangle
) As Boolean
Dim refDstRect As Rectangle
Dim refSrcRect1 As Rectangle
Dim refSrcRect2 As Rectangle
Dim returnValue As Boolean
returnValue = User32.SubtractRect(refDstRect,
refSrcRect1, refSrcRect2)
public:
[DllImportAttribute(L"User32.dll")]
static bool SubtractRect(
[OutAttribute] Rectangle% refDstRect,
[InAttribute] Rectangle% refSrcRect1,
[InAttribute] Rectangle% refSrcRect2
)
[<DllImportAttribute("User32.dll")>]
static member SubtractRect :
refDstRect : Rectangle byref *
refSrcRect1 : Rectangle byref *
refSrcRect2 : Rectangle byref -> bool
No code example is currently available or this language may not be supported.
- refDstRect Rectangle
-
A pointer to the Rectangle structure that receives the coordinates of the
Rectangle determined by subtracting the Rectangle pointed to
by refSrcRect2 from the Rectangle pointed to by refSrcRect1.
- refSrcRect1 Rectangle
-
A pointer to a Rectangle structure
from which the function subtracts the Rectangle pointed to by refSrcRect2.
- refSrcRect2 Rectangle
-
A pointer to a Rectangle structure
that the function subtracts from the Rectangle pointed to by refSrcRect1.
Boolean
If the resulting rectangle is empty, the return value is
.
If the resulting rectangle is not empty, the return value is
.