Movatterモバイル変換


[0]ホーム

URL:


Skip to main content

This browser is no longer supported.

Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.

Download Microsoft EdgeMore info about Internet Explorer and Microsoft Edge
Table of contentsExit editor mode

CreateRectRgn function (wingdi.h)

Feedback

In this article

TheCreateRectRgn function creates a rectangular region.

Syntax

HRGN CreateRectRgn(  [in] int x1,  [in] int y1,  [in] int x2,  [in] int y2);

Parameters

[in] x1

Specifies the x-coordinate of the upper-left corner of the region in logical units.

[in] y1

Specifies the y-coordinate of the upper-left corner of the region in logical units.

[in] x2

Specifies the x-coordinate of the lower-right corner of the region in logical units.

[in] y2

Specifies the y-coordinate of the lower-right corner of the region in logical units.

Return value

If the function succeeds, the return value is the handle to the region.

If the function fails, the return value isNULL.

Remarks

When you no longer need theHRGN object, call theDeleteObject function to delete it.

Region coordinates are represented as 27-bit signed integers.

Regions created by the Create<shape>Rgn methods (such asCreateRectRgn andCreatePolygonRgn) only include the interior of the shape; the shape's outline is excluded from the region. This means that any point on a line between two sequential vertices is not included in the region. If you were to callPtInRegion for such a point, it would return zero as the result.

Examples

For an example, seeDrawing Markers.

Requirements

RequirementValue
Minimum supported clientWindows 2000 Professional [desktop apps only]
Minimum supported serverWindows 2000 Server [desktop apps only]
Target PlatformWindows
Headerwingdi.h (include Windows.h)
LibraryGdi32.lib
DLLGdi32.dll

See also

CreatePolyPolygonRgn

CreatePolygonRgn

CreateRectRgnIndirect

CreateRoundRectRgn

DeleteObject

ExtCreateRegion

GetRegionData

Region Functions

Regions Overview

SelectObject


Feedback

Was this page helpful?

YesNoNo

Need help with this topic?

Want to try using Ask Learn to clarify or guide you through this topic?

Suggest a fix?

  • Last updated on

In this article

Was this page helpful?

YesNo
NoNeed help with this topic?

Want to try using Ask Learn to clarify or guide you through this topic?

Suggest a fix?