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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? toolbarex.cpp

?? 使用RFID的一個監控程序
?? CPP
?? 第 1 頁 / 共 2 頁
字號:
	LPCTSTR lpszResourceName=MAKEINTRESOURCE(nIDResource);
	ASSERT_VALID(this);
	ASSERT(lpszResourceName != NULL);
	
	// determine location of the bitmap in resource fork
	HINSTANCE hInst = AfxFindResourceHandle(lpszResourceName, RT_TOOLBAR);
	HRSRC hRsrc = ::FindResource(hInst, lpszResourceName, RT_TOOLBAR);
	if (hRsrc == NULL)
		return FALSE;
	
	CBitmap tmp;
	BITMAP BitMap; 
	tmp.LoadBitmap(lpszResourceName);
	if(tmp.GetBitmap(&BitMap)==0)
		return FALSE;
	
	HGLOBAL hGlobal = LoadResource(hInst, hRsrc);
	if (hGlobal == NULL)
		return FALSE;
	
	CToolBarData* pData = (CToolBarData*)LockResource(hGlobal);
	if (pData == NULL)
		return FALSE;
	ASSERT(pData->wVersion == 1);
    m_pbtButtonStyle=new BYTE[pData->wItemCount];
	UINT* pItems = new UINT[pData->wItemCount];
	for (int i = 0; i < pData->wItemCount; i++)
		pItems[i] = pData->items()[i];
	BOOL bResult = SetButtons(pItems, pData->wItemCount);
	delete[] pItems;
	
    m_nButtonCount=pData->wItemCount;
	for(int j = 0; j <pData->wItemCount; j++)
	{
		if(TBBS_SEPARATOR==GetButtonStyle(j))
		{
			m_nButtonCount--;
			m_pbtButtonStyle[j]=1;
		}
		else
			m_pbtButtonStyle[j]=0;
	}
	m_nSeparatorCount=pData->wItemCount-m_nButtonCount;
	pData->wWidth=BitMap.bmWidth/m_nButtonCount;
	pData->wHeight=(UINT)BitMap.bmHeight;
		
	m_nButtonWidth=BitMap.bmWidth/m_nButtonCount;
	m_nButtonHeight=pData->wHeight;
		
	if (bResult)
	{
		// set new sizes of the buttons
		CSize sizeImage(pData->wWidth, pData->wHeight);
		CSize sizeButton(pData->wWidth + 7, pData->wHeight + 7);
		m_ButtonSize=sizeButton;
		SetSizes(sizeButton, sizeImage);
		
		// load bitmap now that sizes are known by the toolbar control
		bResult = LoadBitmap(lpszResourceName);
	}
		
	UnlockResource(hGlobal);
	FreeResource(hGlobal);
	
	
	return bResult;
}

BOOL CToolBarEx::LoadBitmap(LPCTSTR lpszResourceName)
{
	ASSERT_VALID(this);
	ASSERT(lpszResourceName != NULL);
	
	// determine location of the bitmap in resource fork
	HINSTANCE hInstImageWell = AfxFindResourceHandle(lpszResourceName, RT_BITMAP);
	HRSRC hRsrcImageWell = ::FindResource(hInstImageWell, lpszResourceName, RT_BITMAP);
	if (hRsrcImageWell == NULL)
		return FALSE;
	
	
	HGLOBAL hglb;
	if ((hglb = LoadResource(hInstImageWell, hRsrcImageWell)) == NULL)
		return FALSE;
	
	LPBITMAPINFOHEADER lpBitmap = (LPBITMAPINFOHEADER)LockResource(hglb);
	if (lpBitmap == NULL)
		return NULL;
	
	m_wToolBarBitCount=lpBitmap->biBitCount;
	
	::FreeResource(hglb);
    //if(m_wToolBarBitCount<8)//如果工具欄顏色小于等于256色則調用原函數
	//{
	//	return CToolBar::LoadBitmap(lpszResourceName);
	//}
	m_lpszResourceName=lpszResourceName;
    SetButtonEx(lpszResourceName);
	
	return TRUE;
}
BOOL CToolBarEx::SetButtonEx(UINT nIDResource)
{
	LPCTSTR lpszResourceName=MAKEINTRESOURCE(nIDResource);
	return SetButtonEx(lpszResourceName);
}
BOOL CToolBarEx::SetButtonEx(LPCTSTR lpszResourceName)
{
    CClientDC rdc(this);
	CDC dc1,dc2,dc3,dc4;
	
	CBitmap bmp1,bmp2,bmp3,bmp4,bmpd;
	COLORREF pixelcolor,maskcolor;
	BITMAP bitmap;
	BYTE gray=0;
	CRect rc4;

	rc4.top=rc4.left=0;
	if (m_dwStyle & CBRS_ORIENT_HORZ)
	{
		rc4.right=m_ButtonSize.cx*m_nButtonCount+6*m_nSeparatorCount;
		rc4.bottom=m_ButtonSize.cy;
	}
	else
	{
		rc4.right=m_ButtonSize.cx;
		rc4.bottom=m_ButtonSize.cy*m_nButtonCount+6*m_nSeparatorCount;
	}
	
	bmp1.LoadBitmap(lpszResourceName);
	bmp1.GetBitmap(&bitmap); 
	bmp2.CreateBitmap(bitmap.bmWidth,bitmap.bmHeight,1,bitmap.bmBitsPixel,NULL); 
	bmp3.CreateBitmap(bitmap.bmWidth,bitmap.bmHeight,1,bitmap.bmBitsPixel,NULL);  
	bmp4.CreateBitmap(rc4.right,rc4.bottom,1,bitmap.bmBitsPixel,NULL);  
	bmpd.CreateBitmap(bitmap.bmWidth,bitmap.bmHeight,1,bitmap.bmBitsPixel,NULL);  
	
	dc1.CreateCompatibleDC(&rdc);
	dc2.CreateCompatibleDC(&rdc);
	dc3.CreateCompatibleDC(&rdc);
	dc4.CreateCompatibleDC(&rdc);
	
	dc1.SelectObject(&bmp1);
	dc2.SelectObject(&bmp2); 
	dc3.SelectObject(&bmp3); 
	dc4.SelectObject(&bmp4); 

	dc4.FillRect(&rc4,&m_bkbrush); 
	
	maskcolor=dc1.GetPixel(0,0);
	
    CRect rc2;
	rc2.left=rc2.top=0;
	rc2.right=bitmap.bmWidth;
	rc2.bottom=bitmap.bmHeight;
	
	
///////////////////////////////////////////////////////////////////
	//dc2.FillRect(&rc2,&m_bkbrush);
    int totalbuttons=m_nButtonCount+m_nSeparatorCount;
	int buttonindex=0;
	int btnindex=0;
	
	for(buttonindex=0,btnindex=0;buttonindex<totalbuttons;buttonindex++)
	{
	    if(0==m_pbtButtonStyle[buttonindex])
		{
			if (m_dwStyle & CBRS_ORIENT_HORZ)
				dc2.BitBlt(btnindex*m_nButtonWidth,0,m_nButtonWidth,m_nButtonHeight,&dc4,btnindex*m_ButtonSize.cx+6*(buttonindex-btnindex)+3,3,SRCCOPY);
			else if(m_dwStyle & CBRS_ORIENT_VERT)
				dc2.BitBlt(btnindex*m_nButtonWidth,0,m_nButtonWidth,m_nButtonHeight,&dc4,3,btnindex*m_ButtonSize.cy+6*(buttonindex-btnindex)+3,SRCCOPY);
				//dc2.BitBlt(0,btnindex*m_nButtonHeight,m_nButtonWidth,m_nButtonHeight,&dc4,3,3,SRCCOPY);

			btnindex++;
		}
	}
	
	TransparentBltEx(dc2.m_hDC,0,0,bitmap.bmWidth,bitmap.bmHeight,
		dc1.m_hDC,0,0,bitmap.bmWidth,bitmap.bmHeight,maskcolor); 
	

	
	LPBYTE lpbts;
	WORD ncount=0;
	ncount=(WORD)(bitmap.bmHeight*bitmap.bmWidthBytes);  
	lpbts=new BYTE[ncount];
	bmp2.GetBitmapBits(ncount,lpbts); 
	bmpd.SetBitmapBits(ncount,lpbts);
	
	m_imglstNormal.DeleteImageList(); 
	m_imglstNormal.Create(m_nButtonWidth, m_nButtonHeight, bitmap.bmBitsPixel|ILC_MASK, 1, 1);
	m_imglstNormal.Add(&bmpd, maskcolor);
	GetToolBarCtrl().SetImageList(&m_imglstNormal);
	/////////////////////////////////////////////////////////////////////
	//dc3.FillRect(&rc2,&m_bkbrush);
	dc3.BitBlt(0,0,bitmap.bmWidth,bitmap.bmHeight,&dc1,0,0,SRCCOPY); 
	
	for(int l1=0;l1<bitmap.bmWidth;l1++)
	{
		for(int c1=0;c1<bitmap.bmHeight;c1++) 
		{
			pixelcolor=dc3.GetPixel(l1,c1);
			//gray=(BYTE)(GetRValue(pixelcolor)*0.2+GetGValue(pixelcolor)*0.4+GetBValue(pixelcolor)*0.2);
			if(pixelcolor!=maskcolor)
				dc3.SetPixel(l1,c1,RGB(250,250,250)); 
		}
	}	
	for(buttonindex=0,btnindex=0;buttonindex<totalbuttons;buttonindex++)
	{
	    if(0==m_pbtButtonStyle[buttonindex])
		{
			if (m_dwStyle & CBRS_ORIENT_HORZ)
				dc2.BitBlt(btnindex*m_nButtonWidth,0,m_nButtonWidth,m_nButtonHeight,&dc4,btnindex*m_ButtonSize.cx+6*(buttonindex-btnindex)+3,3,SRCCOPY);
			else if(m_dwStyle & CBRS_ORIENT_VERT)
				dc2.BitBlt(btnindex*m_nButtonWidth,0,m_nButtonWidth,m_nButtonHeight,&dc4,3,btnindex*m_ButtonSize.cy+6*(buttonindex-btnindex)+3,SRCCOPY);
				//dc2.BitBlt(0,btnindex*m_nButtonHeight,m_nButtonWidth,m_nButtonHeight,&dc4,3,3,SRCCOPY);

			btnindex++;
		}
	}
	TransparentBltEx(dc2.m_hDC,1,1,bitmap.bmWidth,bitmap.bmHeight,
		dc3.m_hDC,0,0,bitmap.bmWidth,bitmap.bmHeight,maskcolor); 
	
	dc3.BitBlt(0,0,bitmap.bmWidth,bitmap.bmHeight,&dc1,0,0,SRCCOPY); 
	
	for(int l=0;l<bitmap.bmWidth;l++)
	{
		for(int c=0;c<bitmap.bmHeight;c++) 
		{
			pixelcolor=dc3.GetPixel(l,c);
			gray=(BYTE)(GetRValue(pixelcolor)*0.2+GetGValue(pixelcolor)*0.4+GetBValue(pixelcolor)*0.2);
			if(pixelcolor!=maskcolor)
				dc3.SetPixel(l,c,RGB(gray,gray,gray)); 
		}
	}	
	TransparentBltEx(dc2.m_hDC,0,0,bitmap.bmWidth,bitmap.bmHeight,
		dc3.m_hDC,0,0,bitmap.bmWidth,bitmap.bmHeight,maskcolor); 
	
	bmp2.GetBitmapBits(ncount,lpbts); 
	bmpd.SetBitmapBits(ncount,lpbts);
	
	m_imglstDisabled.DeleteImageList(); 
	m_imglstDisabled.Create(m_nButtonWidth, m_nButtonHeight, bitmap.bmBitsPixel|ILC_MASK, 1, 1);
	m_imglstDisabled.Add(&bmpd, maskcolor);
	GetToolBarCtrl().SetDisabledImageList(&m_imglstDisabled);
	
	
	/////////////////////////////////////////////////////////////////////
	dc3.BitBlt(0,0,bitmap.bmWidth,bitmap.bmHeight,&dc1,0,0,SRCCOPY); 
	for(int l3=0;l3<bitmap.bmWidth;l3++)
	{
		for(int c3=0;c3<bitmap.bmHeight;c3++) 
		{
			pixelcolor=dc3.GetPixel(l3,c3);
			if(pixelcolor!=maskcolor)
				dc3.SetPixel(l3,c3,\
				RGB(\
				GetRValue(pixelcolor)>240?255:GetRValue(pixelcolor)+15,\
				GetGValue(pixelcolor)>200?255:GetGValue(pixelcolor)+55,\
				GetBValue(pixelcolor)>240?255:GetBValue(pixelcolor)+15
				)); 
		}	
	}	
				
	for(buttonindex=0,btnindex=0;buttonindex<totalbuttons;buttonindex++)
	{
	    if(0==m_pbtButtonStyle[buttonindex])
		{
			if (m_dwStyle & CBRS_ORIENT_HORZ)
				dc2.BitBlt(btnindex*m_nButtonWidth,0,m_nButtonWidth,m_nButtonHeight,&dc4,btnindex*m_ButtonSize.cx+6*(buttonindex-btnindex)+3,3,SRCCOPY);
			else if(m_dwStyle & CBRS_ORIENT_VERT)
				dc2.BitBlt(btnindex*m_nButtonWidth,0,m_nButtonWidth,m_nButtonHeight,&dc4,3,btnindex*m_ButtonSize.cy+6*(buttonindex-btnindex)+3,SRCCOPY);
				//dc2.BitBlt(0,btnindex*m_nButtonHeight,m_nButtonWidth,m_nButtonHeight,&dc4,3,3,SRCCOPY);

			btnindex++;
		}
	}
	TransparentBltEx(dc2.m_hDC,0,0,bitmap.bmWidth,bitmap.bmHeight,\
	dc3.m_hDC,0,0,bitmap.bmWidth,bitmap.bmHeight,maskcolor); 
				
				
	bmp2.GetBitmapBits(ncount,lpbts); 
	bmpd.SetBitmapBits(ncount,lpbts);
				
	m_imglstHot.DeleteImageList(); 
	m_imglstHot.Create(m_nButtonWidth, m_nButtonHeight, bitmap.bmBitsPixel|ILC_MASK, 1, 1);
	m_imglstHot.Add(&bmpd, maskcolor);
	GetToolBarCtrl().SetHotImageList(&m_imglstHot);
	CRect rt;
	GetToolBarCtrl().GetClientRect(&rt); 
	TBBUTTONINFO btinfo;
	int wx=0;
	for(UINT k=0;k<m_nButtonCount;k++)
	{
		GetToolBarCtrl().GetButtonInfo(k,&btinfo);
		wx+=btinfo.cx;
	}
	
	delete[] lpbts;
	return TRUE;
}

void CToolBarEx::MouseHover(POINT pt)
{
	if (m_dwStyle & CBRS_FLOATING) {
		// no grippers
	} else if (m_dwStyle & CBRS_ORIENT_HORZ) {
		// gripper at left
		CRect rc;
		GetWindowRect(&rc);
		rc.right=rc.left+8;
		if(rc.PtInRect(pt))
			::SetCursor(::LoadCursor(NULL,IDC_SIZEALL)); 
	} else {
		// gripper at top
		CRect rc;
		GetWindowRect(&rc);
		rc.bottom=rc.top+8;
		if(rc.PtInRect(pt))
			::SetCursor(::LoadCursor(NULL,IDC_SIZEALL)); 
	}

}
BOOL CToolBarEx::PreTranslateMessage(MSG* pMsg)
{
	switch(pMsg->message)
	{
	case WM_MOUSEMOVE:
		MouseHover(pMsg->pt);	
        break;
	}
	return CToolBar::PreTranslateMessage(pMsg); 
}

void CToolBarEx::OnBarStyleChange(DWORD dwOldStyle, DWORD dwNewStyle)
{
	CToolBar::OnBarStyleChange(dwOldStyle,dwNewStyle);
	if(( (dwOldStyle & CBRS_ORIENT_HORZ)&& (dwOldStyle & CBRS_ORIENT_VERT))||\
		( (dwOldStyle & CBRS_ORIENT_VERT)&& (dwOldStyle & CBRS_ORIENT_HORZ)))
	{
		LoadBitmap(m_lpszResourceName);
		Invalidate();
	}
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美一级日韩免费不卡| 7777精品伊人久久久大香线蕉最新版| 亚洲四区在线观看| 亚洲成人av电影在线| 精品美女在线播放| 欧美在线制服丝袜| 大美女一区二区三区| 日精品一区二区三区| 亚洲蜜桃精久久久久久久| 国产亚洲精品aa午夜观看| 91精品国产一区二区人妖| 91成人免费在线| 成人av资源网站| 国产精品中文字幕一区二区三区| 午夜一区二区三区在线观看| 国产精品欧美久久久久一区二区 | 欧美视频在线一区| 国产不卡视频一区| 国产自产高清不卡| 奇米精品一区二区三区四区| 亚洲一区二区三区三| 亚洲欧洲制服丝袜| 国产欧美一区二区三区鸳鸯浴| 欧美一区在线视频| 91精品国产欧美日韩| 精品视频在线免费观看| 色香蕉成人二区免费| 成人avav影音| 国产成人精品一区二区三区网站观看| 久久机这里只有精品| 日本不卡不码高清免费观看| 亚洲va欧美va国产va天堂影院| 亚洲愉拍自拍另类高清精品| 亚洲伦在线观看| 1000精品久久久久久久久| 国产精品久久夜| 亚洲欧洲成人av每日更新| 国产精品美女一区二区三区| 欧美极品少妇xxxxⅹ高跟鞋| 欧美激情在线看| 1024成人网| 一区二区三区丝袜| 偷拍自拍另类欧美| 蜜臀av性久久久久蜜臀aⅴ四虎| 日本女优在线视频一区二区| 日本午夜精品视频在线观看| 丝袜美腿亚洲一区二区图片| 免费在线看成人av| 精品一区二区三区香蕉蜜桃| 韩国精品主播一区二区在线观看| 寂寞少妇一区二区三区| 国产精品18久久久久久久久久久久 | 日韩精品一区二区三区在线| 亚洲精品一区在线观看| 国产女同性恋一区二区| 国产精品高潮呻吟| 亚洲靠逼com| 视频一区欧美日韩| 国产一本一道久久香蕉| 成a人片国产精品| 在线中文字幕一区| 欧美一区二区三区在线观看视频| 91精品国产91久久久久久一区二区 | 亚洲精品网站在线观看| 久久久久久麻豆| 国产精品盗摄一区二区三区| 亚洲自拍偷拍欧美| 久久99精品久久久久久动态图| 高清国产午夜精品久久久久久| 91久久奴性调教| 欧美一区2区视频在线观看| 久久久无码精品亚洲日韩按摩| 国产精品卡一卡二| 午夜电影网一区| 国产精品一品视频| 欧美色网一区二区| 精品国产sm最大网站免费看| 国产精品麻豆视频| 午夜一区二区三区视频| 国产不卡一区视频| 欧美日本一区二区在线观看| 国产亚洲欧美中文| 夜夜亚洲天天久久| 国产精品99久久久久久久vr| 欧美三级乱人伦电影| 久久精品一二三| 亚洲一区二区三区四区中文字幕| 免费成人av资源网| a4yy欧美一区二区三区| 91精品国产入口| 玉米视频成人免费看| 精彩视频一区二区三区| 欧美在线制服丝袜| 国产欧美日韩一区二区三区在线观看 | 欧美顶级少妇做爰| 国产精品久久精品日日| 美女mm1313爽爽久久久蜜臀| 色偷偷久久一区二区三区| 精品裸体舞一区二区三区| 亚洲综合网站在线观看| 国产成人免费视频网站高清观看视频 | 中文字幕在线免费不卡| 精品中文字幕一区二区小辣椒| 欧洲视频一区二区| 国产精品女主播在线观看| 麻豆视频观看网址久久| 色av综合在线| 国产精品区一区二区三区| 久久99久久精品欧美| 欧美日韩www| 亚洲精选免费视频| 粉嫩av一区二区三区| 日韩免费福利电影在线观看| 无码av免费一区二区三区试看 | 精品欧美久久久| 午夜精品久久久久久久99樱桃 | 91视视频在线观看入口直接观看www| 精品欧美黑人一区二区三区| 天使萌一区二区三区免费观看| 日本道精品一区二区三区| 中文字幕一区二区三区在线播放| 国产乱子伦视频一区二区三区| 日韩欧美国产精品| 日韩电影一区二区三区| 欧美日韩精品欧美日韩精品| 亚洲永久精品大片| 91啦中文在线观看| 亚洲日本va在线观看| 99久久国产综合精品女不卡| 中文字幕av免费专区久久| 国产精品456露脸| 国产三级欧美三级日产三级99| 久久精品国产77777蜜臀| 日韩欧美一区二区视频| 日本vs亚洲vs韩国一区三区二区| 欧美日本一区二区在线观看| 五月婷婷激情综合网| 7777精品伊人久久久大香线蕉完整版 | 久久99精品国产.久久久久| 日韩亚洲欧美成人一区| 久久er精品视频| 337p粉嫩大胆色噜噜噜噜亚洲| 精品一区二区三区的国产在线播放| 日韩欧美高清在线| 国产主播一区二区三区| 国产亚洲欧美在线| 99久久精品国产精品久久| 成人免费小视频| 色系网站成人免费| 日韩经典一区二区| 精品国产精品一区二区夜夜嗨| 国产一区二区三区日韩| 国产午夜精品一区二区三区四区| 成人精品鲁一区一区二区| 专区另类欧美日韩| 在线观看91视频| 免费黄网站欧美| 久久久久久日产精品| www.欧美日韩| 亚洲高清在线精品| 精品蜜桃在线看| jvid福利写真一区二区三区| 一区二区三区四区在线| 欧美一区二视频| 国产成人午夜精品影院观看视频| 亚洲欧洲成人精品av97| 欧美人xxxx| 国产裸体歌舞团一区二区| 亚洲欧美自拍偷拍色图| 欧美日韩国产片| 狠狠色综合播放一区二区| 亚洲免费观看高清在线观看| 91精品国产综合久久婷婷香蕉 | 一区二区三区国产精品| 日韩一区二区三区在线| 不卡欧美aaaaa| 日本不卡视频一二三区| 中文字幕一区不卡| 91精品国产91久久综合桃花| 成人国产精品免费观看| 五月天激情综合| 久久久www成人免费毛片麻豆| 91免费看视频| 国内外成人在线视频| 亚洲精品国产精华液| 26uuu久久综合| 欧美日韩在线亚洲一区蜜芽| 国产一区在线观看视频| 亚洲午夜av在线| 国产午夜精品一区二区三区视频| 欧美性生交片4| 福利电影一区二区三区| 日韩在线观看一区二区| 亚洲三级电影全部在线观看高清| 日韩视频中午一区| 91激情在线视频| 成人一区二区视频| 国产专区欧美精品| 日本亚洲电影天堂| 亚洲国产你懂的|