Region::Complement(constRect&) メソッド (gdiplusheaders.h)
Region::Complement メソッドは、この領域と交差しない、指定した四角形の内部の部分にこの領域を更新します。
構文
Status Complement(
const Rect & rect
);
パラメーター
rect
この Region オブジェクトの更新に使用する四角形への参照。
戻り値
メソッドが成功した場合は、ok を返します。これは、Status 列挙体の要素です。
メソッドが失敗した場合は、Status 列挙体の他の要素のいずれかを返します。
備考
例
次の例では、パスから領域を作成し、四角形を使用して領域を更新します。
VOID Example_ComplementRect(HDC hdc)
{
Graphics graphics(hdc);
SolidBrush solidBrush(Color(255, 255, 0, 0));
Point points[] = {
Point(110, 20),
Point(120, 30),
Point(100, 60),
Point(120, 70),
Point(150, 60),
Point(140, 10)};
Rect rect(65, 15, 70, 45);
GraphicsPath path;
path.AddClosedCurve(points, 6);
// Create a region from a path.
Region region(&path);
// Update the region so that it consists of all points inside the
// rectangle but outside the path region.
region.Complement(rect);
graphics.FillRegion(&solidBrush, ®ion);
}
必要条件
要件 | 価値 |
---|---|
ヘッダー | gdiplusheaders.h |