CBrush::GetLogBrush

Chamar essa função de membro para recuperar a estrutura de LOGBRUSH .

int GetLogBrush(
   LOGBRUSH* pLogBrush 
);

Parâmetros

  • pLogBrush
    Os pontos a LOGBRUSH estrutura que contém informações sobre o pincel.

Valor de retorno

Se a função é bem-sucedido, e pLogBrush é um ponteiro válido, o valor de retorno é o número de bytes armazenados em buffer.

Se a função é bem-sucedido, e pLogBrush é NULO, o valor de retorno é o número de bytes necessários para armazenar as informações que a função iria armazenar em buffer.

Se a função falhar, o valor de retorno é 0.

Comentários

A estrutura de LOGBRUSH define o estilo, a cor, e o padrão de um pincel.

Por exemplo, chame GetLogBrush para corresponder a cor ou o padrão específico de um bitmap.

Exemplo

// 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();
}

Requisitos

Cabeçalho: afxwin.h

Consulte também

Referência

Classe de CBrush

Gráfico de hierarquia

LOGBRUSH

GetObject