亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? ctrl_color.shtml

?? mfc資源大全包含MFC編程各個方面的源碼
?? SHTML
字號:
<HTML>
<HEAD>
   <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
   <META NAME="Author" CONTENT="Zafir Anjum">
   <TITLE>CTreeCtrl - Setting a background color</TITLE>
</HEAD>
<body background="../fancyhome/back.gif" bgcolor="#FFFFFF" link="#B50029" vlink="#8E2323" alink="#FF0000" bgproperties="fixed">
<table WIDTH="100%">
<tr WIDTH="100%">
<td align=center><!--#exec cgi="/cgi/ads.cgi"--><td>
</tr>
</table>


<CENTER>
<H3>
<FONT COLOR="#AOAO99">Setting a background color</FONT></H3></CENTER>

<CENTER>
<H3>

<HR></H3></CENTER>
Like any other control, you can handle the WM_CTLCOLOR message for the tree view control too. You can set the background color and it works - kind of. When the control draws the tree items, it ignores the color set by the WM_CTLCOLOR handler and uses the system color. The net effect is that portions of the control not covered by any tree item gets the custom color but the tree items have the system color as the background. I bet, that's not the kind of effect you are looking for.

<p><img src="ctrl_color.gif" width="270" height="275"></p>

<p>The approach we will take to get a uniform background color is that whenever the control needs painting, we will paint the background, we will let the control draw the items in a memory device context and then paint this image transparently onto the control surface.

<h4>Step 1: Add handler function for WM_PAINT</h4>
Whenever the control needs to be updated the OnPaint() function gets called. We first create a memory device context that matches the paint DC in terms of the bitmap selected in it and the clip region. We let the default window procedure of the control draw in the memory DC using the system color as the background color. 

<p>Next we create a mask bitmap using yet another device context. A mask bitmap is a monochrome bitmap in which one color indicates the background color in the source bitmap and the other color indicates all the bits that are not the background color. We need the mask bitmap to copy only the foreground color from the memory DC to the paint DC.

<p>Once we have the mask bitmap, we draw the background color using the 
paint DC and then draw the image in the memory DC transparently over the 
paint DC. I had initially used MaskBlt() for drawing the image transparently 
but found out that it was supported on NT only and not Windows 95. Here's 
what we do. The image in memDC is the foreground image. When drawing this 
image we have to somehow make the background color have no effect. We achieve 
this by setting the background to black using the mask bitmap. When we later use 
the SRCPAINT raster operation, the black color has no effect on the destination 
color. Similarly we use the mask bitmap to set the foreground color of the 
image in the paint DC to black. We finally combine the two images.

<p>Thanks to Matthias Kerkhoff from Germany for pointing out the problem with MaskBlt()
and suggesting the new method for drawing the image transparently.

<PRE><TT><FONT COLOR="#990000">void CTreeCtrlX::OnPaint() 
{
	CPaintDC dc(this);
	
	// Create a memory DC compatible with the paint DC
	CDC memDC;
	memDC.CreateCompatibleDC( &dc );

	CRect rcClip, rcClient;
	dc.GetClipBox( &rcClip );
	GetClientRect(&rcClient);

	// Select a compatible bitmap into the memory DC
	CBitmap bitmap;
	bitmap.CreateCompatibleBitmap( &dc, rcClient.Width(), rcClient.Height() );
	memDC.SelectObject( &bitmap );
	
	// Set clip region to be same as that in paint DC
	CRgn rgn;
	rgn.CreateRectRgnIndirect( &rcClip );
	memDC.SelectClipRgn(&rgn);
	rgn.DeleteObject();
	
	// First let the control do its default drawing.
	CWnd::DefWindowProc( WM_PAINT, (WPARAM)memDC.m_hDC, 0 );


	// Now create a mask
	CDC maskDC;
	maskDC.CreateCompatibleDC(&dc);
	CBitmap maskBitmap;

	// Create monochrome bitmap for the mask
	maskBitmap.CreateBitmap( rcClip.Width(), rcClip.Height(), 1, 1, NULL );
	maskDC.SelectObject( &maskBitmap );
	memDC.SetBkColor( ::GetSysColor( COLOR_WINDOW ) );

	// Create the mask from the memory DC
	maskDC.BitBlt( 0, 0, rcClip.Width(), rcClip.Height(), &memDC, 
				rcClip.left, rcClip.top, SRCCOPY );

	// Fill the background with custom color
	// Use a protected member variable to save the color
	// rather than hard coding it.
	dc.FillRect(rcClip, &CBrush(RGB(255,255,192)) );
	
	// Copy the image in memDC transparently

	// MaskBlt works in NT only - so we use another method
	//	dc.MaskBlt( rcClip.left, rcClip.top, rcClip.Width(), rcClip.Height(), &memDC, 
	//			rcClip.left, rcClip.top, maskBitmap, 0, 0, 
	//			MAKEROP4(SRCAND,SRCCOPY) );


	// Set the background in memDC to black. Using SRCPAINT with black and any other
	// color results in the other color, thus making black the transparent color
	memDC.SetBkColor(RGB(0,0,0));          
	memDC.SetTextColor(RGB(255,255,255));  
	memDC.BitBlt(rcClip.left, rcClip.top, rcClip.Width(), rcClip.Height(), &maskDC, rcClip.left, rcClip.top, SRCAND);

	// Set the foreground to black. See comment above.
	dc.SetBkColor(RGB(255,255,255));
	dc.SetTextColor(RGB(0,0,0));
	dc.BitBlt(rcClip.left, rcClip.top, rcClip.Width(), rcClip.Height(), &maskDC, rcClip.left, rcClip.top, SRCAND);
	
	// Combine the foreground with the background
	dc.BitBlt(rcClip.left, rcClip.top, rcClip.Width(), rcClip.Height(), &memDC, 
					rcClip.left, rcClip.top,SRCPAINT);
}
</FONT></TT></PRE>

<h4>Step 2: Add handler for WM_ERASEBKGND</h4>
Since we are already drawing the background in the OnPaint() function handling this function and simply returning TRUE ensures that the default window procedure does not erase the background. Adding this handler prevents extra updates to the control's client area and thus reduces flicker.

<p>In actual production code, you'd probably check for a non default background color before returning TRUE;

<PRE><TT><FONT COLOR="#990000">BOOL CTreeCtrlX::OnEraseBkgnd(CDC* pDC) 
{
 	// To prevent flickering when using non default bkcolor
	return TRUE;
}
</FONT></TT></PRE>

<P>
<HR>
<TABLE BORDER=0 WIDTH="100%" >
<TR>
<TD WIDTH="33%"><FONT SIZE=-1><A HREF="http://www.codeguru.com">Goto HomePage</A></FONT></TD>

<TD WIDTH="33%">
<CENTER><FONT SIZE=-2>&copy; 1998 Zafir Anjum</FONT>&nbsp;</CENTER>
</TD>

<TD WIDTH="34%">
<DIV ALIGN=right><FONT SIZE=-1>Contact me: <A HREF="mailto:zafir@home.com">zafir@home.com</A>&nbsp;</FONT></DIV>
</TD>
</TR>
</TABLE>
</BODY>
</HTML>

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
性欧美大战久久久久久久久| 成人高清免费观看| 成人午夜碰碰视频| 欧美日韩成人一区| 中文字幕字幕中文在线中不卡视频| 日韩精品1区2区3区| 99re在线精品| 欧美激情一区二区三区不卡 | 正在播放亚洲一区| 亚洲欧美日韩国产手机在线| 午夜精品一区二区三区三上悠亚| 1区2区3区精品视频| 天堂精品中文字幕在线| 成人av片在线观看| 精品国产精品网麻豆系列| 亚洲成人精品一区| 91行情网站电视在线观看高清版| 欧美国产日韩亚洲一区| 精品一区二区三区在线播放视频| 欧美精品久久一区二区三区| 亚洲自拍欧美精品| 在线亚洲精品福利网址导航| 亚洲天堂福利av| 91一区二区在线| 亚洲美女偷拍久久| 99精品视频中文字幕| k8久久久一区二区三区| 中文字幕国产一区二区| 韩国一区二区三区| 日韩欧美高清一区| 麻豆精品视频在线| 日韩欧美一区二区免费| 久久草av在线| 精品国产一区二区三区忘忧草| 日韩二区三区四区| 精品日本一线二线三线不卡| 精品亚洲成a人| 久久久久久一级片| 成人高清视频免费观看| 国产精品久久久久久户外露出 | 欧美丰满少妇xxxxx高潮对白| 亚洲成人在线观看视频| 国产精品 欧美精品| 欧美在线观看禁18| 亚洲乱码中文字幕综合| 在线观看一区日韩| 午夜不卡在线视频| 日韩午夜精品视频| 国产精品中文字幕一区二区三区| 久久久综合网站| av电影在线观看一区| 亚洲自拍偷拍综合| 91精品婷婷国产综合久久| 久久国产成人午夜av影院| 欧美成人精精品一区二区频| 国产乱对白刺激视频不卡| 国产精品久久久久aaaa| 在线免费视频一区二区| 日本少妇一区二区| 欧美α欧美αv大片| 久久av老司机精品网站导航| 2020国产精品久久精品美国| 国产91富婆露脸刺激对白| 亚洲欧美日韩国产一区二区三区| 国产欧美精品日韩区二区麻豆天美| 成人免费视频网站在线观看| 亚洲激情av在线| 日韩欧美中文字幕一区| 成人午夜免费av| 午夜成人免费电影| 国产精品色呦呦| 欧美日本国产视频| 99在线热播精品免费| 石原莉奈在线亚洲三区| 自拍偷拍国产亚洲| 精品久久一区二区| 欧洲国产伦久久久久久久| 激情综合色播激情啊| 一区二区三区不卡视频在线观看 | www精品美女久久久tv| 97精品久久久午夜一区二区三区| 蜜臀精品久久久久久蜜臀| 综合久久久久久久| 久久蜜桃一区二区| 国产欧美日韩不卡| 日本韩国精品在线| 国产a级毛片一区| 麻豆极品一区二区三区| 亚洲一级二级三级在线免费观看| 日韩在线一区二区三区| 亚洲视频一区在线| 国产精品日日摸夜夜摸av| 日韩欧美在线网站| 欧美另类一区二区三区| 在线一区二区视频| 色综合久久久久| 成年人网站91| 成人中文字幕电影| 国产91在线看| 国产一区三区三区| 国内精品伊人久久久久影院对白| 亚洲va国产天堂va久久en| 一区二区三区不卡在线观看| 亚洲美女视频在线观看| 国产精品成人一区二区艾草 | www国产成人免费观看视频 深夜成人网| 在线亚洲免费视频| 欧美亚洲一区三区| 欧美性videosxxxxx| 在线亚洲免费视频| 欧美日韩精品电影| 欧美人牲a欧美精品| 91精品国产综合久久久久久久久久 | 欧美片在线播放| 在线播放日韩导航| 日韩亚洲欧美一区二区三区| 日韩欧美一二三四区| 欧美电影免费观看高清完整版在线 | 久久久久久一二三区| 久久美女艺术照精彩视频福利播放| 精品剧情v国产在线观看在线| www国产成人| 亚洲国产精品成人综合色在线婷婷 | 日本亚洲三级在线| 久久av中文字幕片| 国产成人午夜精品影院观看视频| 成人手机电影网| 91看片淫黄大片一级在线观看| 91福利精品第一导航| 69成人精品免费视频| 日韩一区二区三区精品视频| xfplay精品久久| 国产精品第四页| 亚洲国产精品精华液网站| 人妖欧美一区二区| 国产传媒一区在线| 日本黄色一区二区| 日韩一级完整毛片| 中文字幕免费不卡在线| 亚洲激情校园春色| 蜜臀av在线播放一区二区三区| 久久不见久久见免费视频7| 国产·精品毛片| 欧美性受极品xxxx喷水| 精品国产第一区二区三区观看体验 | 色网站国产精品| 日韩精品一区二区三区在线| 国产精品乱人伦| 亚洲1区2区3区视频| 国产精品一区二区免费不卡| 欧美亚洲一区二区在线| 国产亚洲一区二区三区四区| 一区二区三区四区高清精品免费观看 | 欧美日韩免费电影| 久久夜色精品国产噜噜av| 亚洲精品国产高清久久伦理二区| 久久91精品久久久久久秒播| 色偷偷成人一区二区三区91| 精品国产乱码久久久久久图片| 亚洲黄色片在线观看| 国产成人精品亚洲午夜麻豆| 欧美私人免费视频| 国产精品丝袜黑色高跟| 免费在线观看精品| 欧美在线免费观看亚洲| 国产三级欧美三级日产三级99| 日韩精品一级中文字幕精品视频免费观看 | 亚洲少妇最新在线视频| 激情综合网最新| 欧美男人的天堂一二区| 最新日韩在线视频| 国产精品99久久久久久久vr | 亚洲欧洲性图库| 国产精品美女www爽爽爽| 亚洲观看高清完整版在线观看| 精品一区二区av| 欧美日韩久久久久久| 国产精品卡一卡二卡三| 日韩成人dvd| 欧美日韩国产中文| 亚洲自拍偷拍图区| 91麻豆精东视频| 国产精品日日摸夜夜摸av| 国产精华液一区二区三区| 精品福利一区二区三区| 肉丝袜脚交视频一区二区| 色猫猫国产区一区二在线视频| 日本一区二区三区高清不卡| 国产精品自拍网站| 精品国产乱子伦一区| 九九**精品视频免费播放| 5566中文字幕一区二区电影| 午夜精品久久久久久久蜜桃app| 色狠狠色噜噜噜综合网| 一区二区日韩av| 99久久精品国产一区| 1区2区3区欧美| 欧美中文字幕一区二区三区亚洲| 亚洲美女视频在线| 国产成人午夜精品5599|