Click to See Complete Forum and Search --> : SetBkMode(TRANSPARENT)???


xnxn
October 19th, 1999, 12:00 PM
Hi,
SetBkMode(TRANSPARENT) , does anyone know anything about it ?
I have an image on which i want to add a grid, but on some computers the
background becomes white.
Has anyone seen this before ?

xnxn

CJE
October 19th, 1999, 04:11 PM
I use this mode when using some of my drawing functions. What specifically do you want to know about it, I may be able to help

xnxn
October 20th, 1999, 03:19 AM
Thanks for your reply,

I have an image on which i want to add a grid, but on some computers the
background becomes white.

Here is the code:

CBrush brush;
if (!brush.CreateBrushIndirect(&m_logbrush))
return;
CPen pen;
if (!pen.CreatePenIndirect(&m_logpen))
return;

CBrush* pOldBrush;
CPen* pOldPen;

if (m_bBrush)
pOldBrush = pDC->SelectObject(&brush);
else
pOldBrush = (CBrush*)pDC->SelectStockObject(NULL_BRUSH);

if (m_bPen)
pOldPen = pDC->SelectObject(&pen);
else
pOldPen = (CPen*)pDC->SelectStockObject(NULL_PEN);

CRect rect = BoundingRect();
pView->DocToClient(rect) ;

int iBkMode = pDC->SetBkMode (TRANSPARENT);
int ropMode = pDC->SetROP2(R2_COPYPEN) ;

CPoint* l_pPoints ;
switch (m_nShape)
{
case rectangle:
pDC->Rectangle(rect);
break;

case ellipse:
pDC->Ellipse(rect);
break;
}

pDC->SetBkMode (iBkMode) ;

pDC->SetROP2(ropMode) ;

pDC->SelectObject(pOldBrush);
pDC->SelectObject(pOldPen);
}



I know it works but again on some computers the background becomes white.
When I checked it in debug mode, all the values appeared normal.

Thanks again,

xnxn