CBrush::CreateBrushIndirect

스타일, 색 및 무늬 지정 브러시로 초기화는 LOGBRUSH 구조.

BOOL CreateBrushIndirect(
   const LOGBRUSH* lpLogBrush 
);

매개 변수

  • lpLogBrush
    가리키는 있는 LOGBRUSH 브러시에 대 한 정보를 포함 하는 구조입니다.

반환 값

함수가 성공 하면 0이 아닌. 그렇지 않으면 0입니다.

설명

이후에 장치 컨텍스트에 대 한 현재 브러시로 브러시를 선택할 수 있습니다.

(평면 1, 픽셀 당 1 비트) 흑백 비트맵을 사용 하 여 만든 브러시는 현재 텍스트 및 배경 색을 사용 하 여 그려집니다.비트가 0으로 설정 하 여 표시 된 픽셀 현재 텍스트 색으로 그려집니다.비트가 1로 설정 하 여 표시 된 픽셀을 현재 배경색으로 그려집니다.

예제

// Initialize a LOGBRUSH structure.
LOGBRUSH logBrush;
logBrush.lbStyle = BS_HATCHED;
logBrush.lbColor = RGB(0, 192, 192);
logBrush.lbHatch = HS_CROSS;

// Declare an uninitialized CBrush ...
CBrush brush;
// ... and initialize it with the LOGBRUSH.
brush.CreateBrushIndirect(&logBrush);

// Select the brush (and perhaps a pen) into
// the device context.
CBrush* pOldBrush = (CBrush*)pDC->SelectObject(&brush);
CPen* pOldPen = (CPen*)pDC->SelectStockObject(BLACK_PEN);

// Have fun!
pDC->Pie(CRect(100, 100, 300, 300), CPoint(0, 0), CPoint(50, 200));

// Restore the original device context objects.
pDC->SelectObject(pOldBrush);
pDC->SelectObject(pOldPen);

요구 사항

헤더: afxwin.h

참고 항목

참조

CBrush 클래스

계층 구조 차트

CBrush::CreateDIBPatternBrush

CBrush::CreatePatternBrush

CBrush::CreateSolidBrush

CBrush::CreateHatchBrush

CGdiObject::CreateStockObject

CGdiObject::DeleteObject

CreateBrushIndirect