Home > Software engineering >  Double buffering is used in the MFC, a bitmap from a memory DC partially transparent display to the
Double buffering is used in the MFC, a bitmap from a memory DC partially transparent display to the

Time:09-19

 bool guess=PDC - & gt; TransparentBlt (
0, 0
, m_ClientRect. Width ()
, m_ClientRect. Height ()
, & amp; M_gridDC
, 0, 0
, m_ClientRect. Width ()
, m_ClientRect. Height ()
, RGB (255, 255, 255));
DWORD x=GetLastError ();//reflection for parameter error

Operation result error code of 87, said parameter errors, but I don't know is which parameter error?

CodePudding user response:

Code of PDC is equipment DC pointer, m_gridDC is a memory DC, rectangular m_ClientRect is equipment

CodePudding user response:

 BOOL TransparentBlt (
Int xDest,
Int yDest,
Int nDestWidth,
Int nDestHeight,
The CDC * pSrcDC,
Int xSrc,
Int ySrc,
Int nSrcWidth,
Int nSrcHeight,
UINT clrTransparent);

DC parameters are interpreted as in the MSDN: equipment in the rectangular coordinates, equipment DC rectangle width, memory DC Pointers, memory DC rectangular coordinates, the memory DC rectangular aspect, needs to be transparent RGB

CodePudding user response:

By the way, in the m_gridDC common BMP bitmap is not, but there is a custom mapping mode of the bitmap

CodePudding user response:

Equipment DC should agree with m_gridDC mapping mode,

CodePudding user response:

reference 4 floor schlafenhamster response:
equipment DC should agree with m_gridDC mapping mode,

Thank you for your reply, I try again,

CodePudding user response:

reference 4 floor schlafenhamster response:
equipment DC should agree with m_gridDC mapping mode,

Hello, still can't show, but it is ok to use BitBlt shows that not only transparent, still can not reach the purpose,
  • Related