Region::GetRegionScansCount 메서드(gdiplusheaders.h)
Region::GetRegionScansCount 메서드는 이 지역의 근사치를 나타내는 사각형 수를 가져옵니다. 영역은 사각형이 계산되기 전에 지정된 행렬에 의해 변환됩니다.
구문
UINT GetRegionScansCount(
[in] const Matrix *matrix
);
매개 변수
[in] matrix
형식: const Matrix*
지역을 변환하는 데 사용되는 행렬에 대한 포인터입니다.
반환 값
형식: UINT
이 메서드는 이 지역의 근사치를 나타내는 사각형 수를 나타내는 정수를 반환합니다.
설명
Region::GetRegionScansCount 메서드를 GetRegionScans 메서드 앞에 사용하여 사각형 수를 확인할 수 있습니다. 그런 다음 GetRegionScans 메서드를 사용하여 가져온 사각형을 저장하기 위해 올바른 크기의 버퍼를 할당할 수 있습니다.
예제
다음 예제에서는 경로에서 영역을 만들고 지역과 근사치를 나타내는 사각형 집합을 가져옵니다. 그런 다음 코드는 각 사각형을 그립니다.
VOID Example_GetRegionScansCount(HDC hdc)
{
Graphics graphics(hdc);
SolidBrush solidBrush(Color(255, 255, 0, 0));
Pen pen(Color(255, 0, 0, 0));
GraphicsPath path;
Matrix matrix;
RectF* rects = NULL;
INT count = 0;
// Create a region from a path.
path.AddEllipse(10, 10, 50, 300);
Region pathRegion(&path);
graphics.FillRegion(&solidBrush, &pathRegion);
// Get the rectangles.
graphics.GetTransform(&matrix);
count = pathRegion.GetRegionScansCount(&matrix);
rects = (RectF*)malloc(count*sizeof(RectF));
pathRegion.GetRegionScans(&matrix, rects, &count);
// Draw the rectangles.
for(INT j = 0; j < count; ++j)
graphics.DrawRectangle(&pen, rects[j]);
free(rects);
}
요구 사항
요구 사항 | 값 |
---|---|
지원되는 최소 클라이언트 | Windows XP, Windows 2000 Professional [데스크톱 앱만 해당] |
지원되는 최소 서버 | Windows 2000 Server[데스크톱 앱만] |
대상 플랫폼 | Windows |
헤더 | gdiplusheaders.h(Gdiplus.h 포함) |
라이브러리 | Gdiplus.lib |
DLL | Gdiplus.dll |