📄 subject_37868.htm
字号:
<p>
序号:37868 发表者:Justin Le 发表日期:2003-04-29 01:59:17
<br>主题:Button自定义画透明效果
<br>内容:CButtonST 2.3<BR> void CButtonST::DrawItem(LPDRAWITEMSTRUCT lpDIS)中调用 PaintBk(pDC)<BR>实现透明效果。<BR>PaintBK(pDC)为什么能实现透明效果?<BR>void CButtonST::PaintBk(CDC* pDC)<BR>{<BR> CClientDC clDC(GetParent());<BR> CRect rect;<BR> CRect rect1;<BR><BR> GetClientRect(rect);<BR><BR> GetWindowRect(rect1);<BR> GetParent()->ScreenToClient(rect1);<BR><BR> if (m_dcBk.m_hDC == NULL)<BR> {<BR> m_dcBk.CreateCompatibleDC(&clDC);<BR> m_bmpBk.CreateCompatibleBitmap(&clDC, rect.Width(), rect.Height());<BR> m_pbmpOldBk = m_dcBk.SelectObject(&m_bmpBk);<BR> m_dcBk.BitBlt(0, 0, rect.Width(), rect.Height(), &clDC, rect1.left, rect1.top, SRCCOPY);<BR> } // if<BR><BR> pDC->BitBlt(0, 0, rect.Width(), rect.Height(), &m_dcBk, 0, 0, SRCCOPY);<BR>} // End of PaintBk<BR><BR>
<br><a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p>
<hr size=1>
<blockquote><p>
<font color=red>答案被接受</font><br>回复者:iwill 回复日期:2003-04-29 08:50:50
<br>内容:这个只是取父窗口的dc来绘制背景,使得背景和父窗口一直而已
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
回复者:Justin Le 回复日期:2003-04-30 01:19:40
<br>内容:我现在有个问题。<BR>我的Dialog用OnCtrlColor设置的背景色。<BR>然后放了一个背景图。<BR><BR>GetParent()<BR>....<BR>的是取背景色,不是取背景图。所以button显示背景色<BR><BR>我去了OnCtrlColor就可以有透明。<BR>可是,我不设置背景色,灰色和我的背景图反差大,闪。<BR>我如何设呢?<BR><BR>====<BR>附件是cbuttonST的background代码<BR>
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
回复者:Justin Le 回复日期:2003-04-30 01:21:11
<br>内容:here!
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -