다음을 통해 공유


CBrush::GetLogBrush

검색 하려면이 멤버 함수를 호출 된 LOGBRUSH 구조.

int GetLogBrush(
   LOGBRUSH* pLogBrush 
);

매개 변수

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

반환 값

함수가 성공 하면 및 pLogBrush 유효한 포인터를 버퍼에 저장 되는 바이트 수를 반환 하는 값입니다.

함수가 성공 하면 및 pLogBrush 는 NULL, 반환 값 함수는 정보를 저장 하는 데 필요한 바이트 수가 버퍼에 저장할 수 있습니다.

함수가 실패 하면 반환 값은 0입니다.

설명

LOGBRUSH 스타일, 색 및 패턴 브러시의 구조를 정의 합니다.

예를 들어, 호출 GetLogBrush 특정 색 이나 패턴은 비트맵에 맞게.

예제

// Example for CBrush::GetLogBrush
LOGBRUSH logbrush;
brushExisting.GetLogBrush( &logbrush );
CBrush brushOther( logbrush.lbColor);

// Another example
// Declare a LOGBRUSH
LOGBRUSH logBrush;

// Using a bitmap for this example.
// The bitmap should be a project resource.
CBitmap bm;
bm.LoadBitmap(IDB_BRUSH);

try
{
   // Create a brush
   CBrush brush1(&bm);

   // Use GetLogBrush to fill the LOGBRUSH structure
   brush1.GetLogBrush(&logBrush);

   // Create a second brush using the LOGBRUSH data
   CBrush brush2;
   brush2.CreateBrushIndirect(&logBrush);

   // Use the first brush
   CBrush* pOldBrush = (CBrush*)pDC->SelectObject(&brush1);
   pDC->Rectangle(CRect(50,50,150,150));

   // The second brush has the specified characteristics
   // of the first brush
   pDC->SelectObject(&brush2);
   pDC->Ellipse(200,50,300,150);

   // Reselect the original brush
   pDC->SelectObject(pOldBrush);
}
catch(CResourceException* e)
{
   e->ReportError();
   e->Delete();
}

요구 사항

헤더: afxwin.h

참고 항목

참조

CBrush 클래스

계층 구조 차트

LOGBRUSH

GetObject