当前位置: 首页>>代码示例>>C++>>正文


C++ CImage::BitBlt方法代码示例

本文整理汇总了C++中CImage::BitBlt方法的典型用法代码示例。如果您正苦于以下问题:C++ CImage::BitBlt方法的具体用法?C++ CImage::BitBlt怎么用?C++ CImage::BitBlt使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CImage的用法示例。


在下文中一共展示了CImage::BitBlt方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: Initialize

BOOL CNCaptureView::Initialize()
{
	BOOL bRet = FALSE;
	if (m_brBackground.m_hBrush)
	{
		API_VERIFY(m_brBackground.DeleteObject());
	}

	CWindowDC dcOwner(m_hWnd);
	CDC dcMemory;
	dcMemory.CreateCompatibleDC(dcOwner);

	SilverlightCpp::ZipManager* pZipManager = SilverlightCpp::ZipManager::get_Current();
	FTLASSERT(pZipManager); 

	CBitmap bmpBackGround;
	CImage* pImgBgPattern  = pZipManager->LoadCImage(_T("/Assets/Images/Main/CaptureView/bg_pattern.png")); // NS
	FTLASSERT(pImgBgPattern);
	if (pImgBgPattern)
	{
		bmpBackGround.CreateCompatibleBitmap(dcOwner, pImgBgPattern->GetWidth(), pImgBgPattern->GetHeight());
		CBitmapHandle holdBitmap = dcMemory.SelectBitmap(bmpBackGround);
		API_VERIFY(pImgBgPattern->BitBlt(dcMemory, 0, 0, SRCCOPY));
		m_brBackground.CreatePatternBrush(bmpBackGround);
		dcMemory.SelectBitmap(holdBitmap);
	}
	//else
	//{
	//	bmpBackGround.CreateCompatibleBitmap(dcOwner, 10, 10);
	//	dcMemory.FillSolidRect(0, 0, 5, 5, IMAGE_BACKGROUND_LTGRAY_COLOR);
	//	dcMemory.FillSolidRect(0, 5, 5, 5, IMAGE_BACKGROUND_GRAY_COLOR);
	//	dcMemory.FillSolidRect(5, 0, 5, 5, IMAGE_BACKGROUND_GRAY_COLOR);
	//	dcMemory.FillSolidRect(5, 5, 5, 5, IMAGE_BACKGROUND_LTGRAY_COLOR);
	//}

	//CImage* pDefaultImage = pZipManager->LoadCImage(_T("/Assets/Images/Main/CaptureView/bg_default_img.png")); // NS
	//FTLASSERT(pDefaultImage);
	//if (pDefaultImage)
	//{
	//	m_pDefaultImage = new NDGraphics::CGDIPImage;
	//	m_pDefaultImage->Load(pDefaultImage, ImageFormatPNG);
	//	//API_VERIFY(m_canvasDefaultImage.Create(NULL, m_pDefaultImage->GetWidth(), m_pDefaultImage->GetHeight(), 32));
	//}

	m_strMousePosInfo = CStringResouceMgr::Instance()->GetStringData(TEXT("NCAPTURE_IMAGE_INFO")).c_str();
	m_strMouseSelectInfo = CStringResouceMgr::Instance()->GetStringData(TEXT("NCAPTURE_IMAGE_SELECT_INFO")).c_str();

	_EventHook();

	//API_VERIFY( NULL != m_brBackGround.CreateHatchBrush(HS_CROSS, RGB(127,127,127)));
	m_bInited = TRUE;
	//CRect rcClient;
	//GetClientRect(rcClient);
	//InvalidateRect(rcClient, TRUE);
	//_CalcImageSize();


	return bRet;
}
开发者ID:moon-sky,项目名称:fishjam-template-library,代码行数:59,代码来源:nCaptureView.cpp

示例2: SetBuffer

int DjvuPic::SetBuffer(CString& fullName,bool check)
{	
	int err=ERR_OK;

	Buffer->Destroy(); 
	Buffer->Create(Parent, Foreground->INFO.bmiHeader.biWidth, Foreground->INFO.bmiHeader.biHeight, 8); 
	Buffer->CreateGrayPallete();			
	CImage TT; TT.Load(FrgFile); TT.BitBlt(Buffer->GetDC(),0,0);
	return err;
}
开发者ID:mar80nik,项目名称:testWMF,代码行数:10,代码来源:DjvuPic.cpp

示例3: OnPaint

void CChildView::OnPaint() 
{
	CPaintDC dc(this); // device context for painting
	// 로드된 이미지
	CImage img;
	LPCTSTR imgPath = imgpath_;
	img.Load(imgPath);

	// 화면 DC에 출력
	if(img != NULL) {
		img.BitBlt(dc.m_hDC, 0, 0);
	}
	else {
		return;
	}
}
开发者ID:enJOYSONG,项目名称:MFCViewerWithMySQL,代码行数:16,代码来源:ChildView.cpp

示例4: OnPaint

//重画函数
void CCardControl::OnPaint()
{
	CPaintDC dc(this);

	//获取位置
	CRect rcClient;
	GetClientRect(&rcClient);

	//加载位图
	CImage ImageBuffer;
	CImageHandle HandleCard(&m_ImageCard);
	CImageHandle HandleFundus(&m_ImageBack);
	ImageBuffer.Create(rcClient.Width(),rcClient.Height(),16);
	if (ImageBuffer.IsNull()==true) return;

	//绘画扑克													                                              
	CDC * pBufferDC=CDC::FromHandle(ImageBuffer.GetDC());

     if(bDrawCard)																	               //add
     {																							   //add
	     for (int i=0;i<m_CardDataArray.GetCount();i++)				   				     
	     {
		   
			 BYTE bCardData=m_CardDataArray[i];
			 m_ImageCard.AlphaDrawImage(pBufferDC,i*CARD_SPACE,0,CARD_WIDTH,CARD_HEIGHT,GetCardXPos(bCardData),GetCardYPos(bCardData),RGB(255,0,255)); //非常好的画图函数
	     }
		    
	 }
    /////////////////////////////////////////////////////////////////////////////////////////begin add
     else																			
     {
		 
	    for(int i=0;i<m_CardDataArray.GetCount();i++)
	    {
			m_ImageBack.AlphaDrawImage(pBufferDC,i*CARD_SPACE,0,CARD_WIDTH,CARD_HEIGHT,3*CARD_WIDTH,4*CARD_HEIGHT,RGB(255,0,255));     //画扑克背面
		}
	 }
    ///////////////////////////////////////////////////////////////////////////////////////////end add
	ImageBuffer.ReleaseDC();
	ImageBuffer.BitBlt(dc,0,0);

	//清理资源
	ImageBuffer.Destroy();

   	return;
}
开发者ID:275958081,项目名称:netfox,代码行数:47,代码来源:CardControl.cpp

示例5: InitImage

// Initialization
void CChildView::InitImage()
{
    CImage image;
    image.LoadFromResource(AfxGetInstanceHandle(), IDB_BITMAP_SAMPLE);

    if ( image.IsNull() )
        return;

    // create 32 bpp image
    m_Image.Create(
        image.GetWidth(),
        image.GetHeight(),
        32);

    int nPitch = m_Image.GetPitch();
    int nWidth = m_Image.GetWidth();
    int nHeight = m_Image.GetHeight();

    ASSERT( m_Image.IsDIBSection() );
    ASSERT( abs(nPitch) == nWidth * 4 );

    // copy from image to m_Image
    image.BitBlt(
        m_Image.GetDC(),
        0, 
        0);

    m_Image.ReleaseDC();


    // get pointer to start of the image in memory
    if ( nPitch > 0 )
        m_pImageBits = (BYTE*) m_Image.GetBits();
    else
        m_pImageBits = (BYTE*) m_Image.GetBits() - (nHeight - 1) * nWidth * 4;

    // keep initial image state in m_pInitialImage array
    m_pInitialImage = new BYTE[nWidth * nHeight * 4];
    memcpy(m_pInitialImage, m_pImageBits, nWidth * nHeight * 4);

}
开发者ID:hiccupzhu,项目名称:misc_starting,代码行数:42,代码来源:ChildView.cpp

示例6: UpdateImage

void CDlgCapCam::UpdateImage(void)
{
	int i;
	CPen cur_pen, *old_pen=NULL;
	CBrush cur_brush,*old_brush = NULL;
	CPoint point;
	CSize size;
	CRect rect_image;
	CImage * pimage;
	CString str_dis;
	CRect client_rect1;
	CSize paint_size1;
	__time32_t l_time;

	if (!m_img_show.IsNull())
	{
		pimage = &m_img_show;
		_time32(&l_time);

		CWnd * pDis1 = GetDlgItem(IDC_STATIC_IMGSHOW);
		CDC* pDC1 = pDis1->GetDC();
		CDC MemDC1;
		CBitmap MemBitmap1;
		CPen pen_target;

		rect_image = CRect(0,0,pimage->GetWidth()-1, pimage->GetHeight()-1);
		pDis1->GetClientRect(&client_rect1);
		MemDC1.CreateCompatibleDC(pDC1);
		MemBitmap1.CreateCompatibleBitmap(pDC1,rect_image.Width(),rect_image.Height());
		MemDC1.SelectObject(&MemBitmap1);

		MemDC1.SetStretchBltMode(COLORONCOLOR);
		pDC1->SetStretchBltMode(COLORONCOLOR);

		pimage->BitBlt(MemDC1.GetSafeHdc(),rect_image, CPoint(0,0),SRCCOPY);

		//draw other osd targets
		pen_target.CreatePen(PS_SOLID, 2, RGB(255, 0, 0));
		MemDC1.SelectStockObject(NULL_BRUSH);
		MemDC1.SelectObject(&pen_target);
		for (i=0; i<m_proc_result_buf.target_set.num; i++)
		{

			MemDC1.Rectangle(m_proc_result_buf.target_set.targets[i].rect.left,
				m_proc_result_buf.target_set.targets[i].rect.bottom,
				m_proc_result_buf.target_set.targets[i].rect.right,
				m_proc_result_buf.target_set.targets[i].rect.top);

		}

		//修改事件抓拍为每10秒钟1次
#define SNATCH_TIME_INTER 10
#define SNATCH_TIME_LATE	120

		time_t cur_time;
		struct tm * now_time;

		time(&cur_time);
		now_time = localtime(&cur_time);

		if (m_proc_result_buf.target_set.num > 0)
		{
			if (cur_time - m_trigger_snatch_time >= SNATCH_TIME_INTER)				
			{
				//超过10s间隔
				ScreenShot(1, SNATCH_TIME_INTER);

				m_trigger_snatch_time = cur_time;
			}
		}

		//延续120秒
		else if(m_trigger_snatch_time > 0 && cur_time - m_trigger_snatch_time <=SNATCH_TIME_LATE)
		{
			ScreenShot(SNATCH_TIME_LATE/SNATCH_TIME_INTER, SNATCH_TIME_INTER);
			m_trigger_snatch_time = 0;
		}


		if (!m_proc_result_buf.flg_used)
		{
			if (m_proc_result_buf.target_set.num)
			{
				((CSTEvaluationDlg*)pWndParent)->AddTarget(&m_proc_result_buf.target_set);
			}
			//do event
			for (i=0; i<m_proc_result_buf.event_set.num; i++)
			{
				//摄像头采集的,帧数置零
				((CSTEvaluationDlg*)pWndParent)->AddEvent(0,l_time,m_proc_result_buf.event_set.events[i].type);
				//同时触发抓拍
				//ScreenShot(12, 10);
			}

			//防止由于刷新,事件被触发两次
			m_proc_result_buf.flg_used = TRUE;
		}



//.........这里部分代码省略.........
开发者ID:pheonixsn,项目名称:STDiagnosticTool,代码行数:101,代码来源:DlgCapCam.cpp

示例7: OnReceiveData


//.........这里部分代码省略.........
		// Get the image type
		BOOL bDIB = Packet.m_bDIB;

		// Get the reset attribute
		BOOL bXOR = Packet.m_bXOR;

		// Get the delta DIB
		CDIBFrame & XOR = m_XOR;

		// Get the viewed DIB
		CDIBFrame & DIB = m_DIB;

		// Get the rectangular coordinates
		CRect Rect = Packet.m_Rect;

		// Check for a PNG
		if (!bDIB)
		{
			// JPEG support
			COleStreamFile ImageStream;

			// Prepare the Image for memory stream serialization
			if (ImageStream.CreateMemoryStream())
			{
				// Write the packet to the stream
				ImageStream.Write(pBuffer,dwBytes);
				IStream * pImageStream = ImageStream.GetStream();

				// Load the image from the stream
				CImage ImageDIB;
				if (pImageStream && SUCCEEDED(ImageDIB.Load(pImageStream)))
				{
					// Transfer the PNG to a DIB
					ImageDIB.BitBlt(DIBPacket,0,0,SRCCOPY);

					// Release the stream
					pImageStream->Release();
				}
			}
		}

		if (bXOR)
		{
			// XOR the current desktop with the last
			BitBlt(DIB,Rect.left,Rect.top,Rect.Width(),Rect.Height(),DIBPacket,0,0,SRCINVERT);
		}
		else
		{
			// Copy over the current desktop
			BitBlt(DIB,Rect.left,Rect.top,Rect.Width(),Rect.Height(),DIBPacket,0,0,SRCCOPY);
		}

		// Update the last DIB
		BitBlt(XOR,0,0,m_cxWidth,m_cyHeight,DIB,0,0,SRCCOPY);

		// Update the screen
		InvalidateRect(NULL,FALSE);
		UpdateWindow();
	}
	else if (Packet.m_ucPacketType == 3) // Cursor
	{
		// Get the cursor data
		DWORD dwXHotSpot = Packet.m_dwXHotSpot;
		DWORD dwYHotSpot = Packet.m_dwYHotSpot;
		int nWidth = Packet.m_bmWidth;
		int nHeight = Packet.m_bmHeight;
开发者ID:Chessa,项目名称:rdp,代码行数:67,代码来源:RDVView.cpp

示例8: OnEraseBkgnd

//绘画背景
BOOL CGameFrameMedalView::OnEraseBkgnd(CDC * pDC)
{
	//获取位置
	CRect rcClient;
	GetClientRect(&rcClient);

	//建立缓冲
	CImage ImageBuffer;
	ImageBuffer.Create(rcClient.Width(),rcClient.Height(),32);

	//创建 DC
	CImageDC BufferDC(ImageBuffer);
	CDC * pBufferDC=CDC::FromHandle(BufferDC);

	//设置缓冲
	pBufferDC->SetBkMode(TRANSPARENT);
	pBufferDC->SetTextAlign(TA_LEFT|TA_TOP);
	pBufferDC->SetTextColor(RGB(250,250,250));
	pBufferDC->SelectObject(CSkinResourceManager::GetInstance()->GetDefaultFont());

	//加载资源
	CImage ImageUserMedalL;
	CImage ImageUserMedalM;
	CImage ImageUserMedalR;
	ImageUserMedalL.LoadFromResource(GetModuleHandle(GAME_FRAME_DLL_NAME),IDB_USER_MEDAL_L);
	ImageUserMedalM.LoadFromResource(GetModuleHandle(GAME_FRAME_DLL_NAME),IDB_USER_MEDAL_M);
	ImageUserMedalR.LoadFromResource(GetModuleHandle(GAME_FRAME_DLL_NAME),IDB_USER_MEDAL_R);

	//变量定义
	INT nXStartPos=ImageUserMedalL.GetWidth();
	INT nXConcludePos=rcClient.Width()-ImageUserMedalR.GetWidth();

	//绘画框架
	ImageUserMedalL.BitBlt(BufferDC,0,0);
	ImageUserMedalR.BitBlt(BufferDC,rcClient.Width()-ImageUserMedalR.GetWidth(),0);

	//绘画中间
	for (INT nXPos=nXStartPos;nXPos<nXConcludePos;nXPos+=ImageUserMedalM.GetWidth())
	{
		INT nCXDraw=__min(ImageUserMedalM.GetWidth(),nXConcludePos-nXPos);
		ImageUserMedalM.BitBlt(BufferDC,nXPos,0,nCXDraw,ImageUserMedalM.GetHeight(),0,0);
	}

	//加载资源
	CPngImageSB ImageCount;
	CPngImageSB ImageStringL;
	CPngImageSB ImageStringR;
	ImageCount.LoadImage(GetModuleHandle(GAME_FRAME_DLL_NAME),TEXT("MEDAL_COUNT"));
	ImageStringL.LoadImage(GetModuleHandle(GAME_FRAME_DLL_NAME),TEXT("MEDAL_STRING_L"));
	ImageStringR.LoadImage(GetModuleHandle(GAME_FRAME_DLL_NAME),TEXT("MEDAL_STRING_R"));

	//获取大小
	CSize SizeCount;
	CSize SizeStringL;
	CSize SizeStringR;
	SizeCount.SetSize(ImageCount.GetWidth()/10L,ImageCount.GetHeight());
	SizeStringL.SetSize(ImageStringL.GetWidth(),ImageStringL.GetHeight());
	SizeStringR.SetSize(ImageStringR.GetWidth(),ImageStringR.GetHeight());

	//构造奖牌
	TCHAR szUserMedal[16]=TEXT("");
	_sntprintf(szUserMedal,CountArray(szUserMedal),TEXT("%ld"),m_dwUserMedal);

	//变量定义
	INT nNumCount=lstrlen(szUserMedal);
	INT nNumStart=(rcClient.Width()-nNumCount*SizeCount.cx)/2+10;

	//绘画字符
	ImageStringL.DrawImage(pBufferDC,nNumStart-SizeStringL.cx-3,4);
	ImageStringR.DrawImage(pBufferDC,nNumStart+nNumCount*SizeCount.cx+3,4);

	//绘画奖牌
	for (INT i=0;i<nNumCount;i++)
	{
		INT nXImage=(szUserMedal[i]-TEXT('0'))*SizeCount.cx;
		ImageCount.DrawImage(pBufferDC,nNumStart+i*SizeCount.cx,7,SizeCount.cx,SizeCount.cy,nXImage,0);
	}

	//绘画界面
	pDC->BitBlt(0,0,rcClient.Width(),rcClient.Height(),pBufferDC,0,0,SRCCOPY);

	return TRUE;
}
开发者ID:cyrillic7,项目名称:CPFrom,代码行数:84,代码来源:GameFrameMedalView.cpp

示例9: BlendDrawImage

//混合绘画
bool CSkinImage::BlendDrawImage(CDC * pDestDC, INT xDest, INT yDest, INT cxDest, INT cyDest, INT xSrc, INT ySrc, COLORREF crTransColor, BYTE cbAlphaDepth)
{
	//无效区域
	CRect rcDirty;
	pDestDC->GetClipBox(&rcDirty);

	//绘画判断
	if (IsNull()==true) return false;

	//位置调整
	tagImageRender ImageRender;
	GetDrawImageArea(xDest,yDest,cxDest,cyDest,xSrc,ySrc,rcDirty,ImageRender);

	//创建位图
	CImage ImageResult;
	CImage ImageSource;
	ImageResult.Create(ImageRender.cxRender,ImageRender.cyRender,32);
	ImageSource.Create(ImageRender.cxRender,ImageRender.cyRender,32);

	//绘画位图
	CDC * pDCImage=CDC::FromHandle(GetDC());
	CDC * pDCResult=CDC::FromHandle(ImageResult.GetDC());
	CDC * pDCSource=CDC::FromHandle(ImageSource.GetDC());
	pDCSource->BitBlt(0,0,ImageRender.cxRender,ImageRender.cyRender,pDCImage,ImageRender.nXImage,ImageRender.nYImage,SRCCOPY);
	pDCResult->BitBlt(0,0,ImageRender.cxRender,ImageRender.cyRender,pDestDC,ImageRender.nXScreen,ImageRender.nYScreen,SRCCOPY);

	//获取属性
	float fAlpha=(float)(cbAlphaDepth/255.0);
	INT nPitchResult=ImageResult.GetPitch();
	INT nPitchSource=ImageSource.GetPitch();

	//获取数据
	LPBYTE cbBitResult=(LPBYTE)ImageResult.GetBits();
	LPBYTE cbBitSource=(LPBYTE)ImageSource.GetBits();

	//创建区域
	for (INT nYPos=0;nYPos<ImageRender.cyRender;nYPos++)
	{
		for (INT nXPos=0;nXPos<ImageRender.cxRender;nXPos++)
		{
			//获取颜色
			COLORREF * pcrResult=(COLORREF *)(cbBitResult+nYPos*nPitchResult+nXPos*4);
			COLORREF * pcrSource=(COLORREF *)(cbBitSource+nYPos*nPitchSource+nXPos*4);

			//混合处理
			if (*pcrSource!=crTransColor)
			{
				//结果颜色
				BYTE cbResultR=GetRValue(*pcrResult);
				BYTE cbResultG=GetGValue(*pcrResult);
				BYTE cbResultB=GetBValue(*pcrResult);

				//原图颜色
				BYTE cbSourceR=GetRValue(*pcrSource);
				BYTE cbSourceG=GetGValue(*pcrSource);
				BYTE cbSourceB=GetBValue(*pcrSource);

				//颜色混合
				cbResultR=(BYTE)(cbSourceR*fAlpha+cbResultR*(1.0-fAlpha));
				cbResultG=(BYTE)(cbSourceG*fAlpha+cbResultG*(1.0-fAlpha));
				cbResultB=(BYTE)(cbSourceB*fAlpha+cbResultB*(1.0-fAlpha));

				//颜色混合
				*pcrResult=RGB(cbResultR,cbResultG,cbResultB);
			}
		}
	}

	//绘画界面
	ImageResult.BitBlt(pDestDC->m_hDC,ImageRender.nXScreen,ImageRender.nYScreen);

	//释放对象
	ReleaseDC();
	ImageSource.ReleaseDC();
	ImageResult.ReleaseDC();

	return true;
}
开发者ID:Michael-Z,项目名称:qipai-game,代码行数:79,代码来源:SkinImage.cpp

示例10: display

//显示图片到DC,ratio为显示百分比
void display(HDC hdc,CImage &image,double ratio)
{
	CImage dstImg;
	Scaling(image,dstImg,ratio);
	dstImg.BitBlt(hdc,0,0,dstImg.GetWidth(),dstImg.GetHeight(),0,0,SRCCOPY);
}
开发者ID:einsnull,项目名称:StupidBoy_with_DNN_Lidar_git,代码行数:7,代码来源:ImageFunctions.cpp

示例11: OnEraseBkgnd

//绘画背景
BOOL CPasswordKeyboard::OnEraseBkgnd(CDC * pDC)
{
	//获取位置
	CRect rcClient;
	GetClientRect(&rcClient);

	//创建缓冲
	CDC BufferDC;
	CBitmap ImageBuffer;
	BufferDC.CreateCompatibleDC(pDC);
	ImageBuffer.CreateCompatibleBitmap(pDC,rcClient.Width(),rcClient.Height());

	//设置环境
	BufferDC.SetBkMode(TRANSPARENT);
	BufferDC.SelectObject(&ImageBuffer);
	BufferDC.SelectObject(CSkinResourceManager::GetInstance()->GetDefaultFont());

	//变量定义
	HINSTANCE hResInstance=GetModuleHandle(SHARE_CONTROL_DLL_NAME);
	CSkinRenderManager * pSkinRenderManager=CSkinRenderManager::GetInstance();

	//加载资源
	CImage ImageItem1;
	CImage ImageItem2;
	CImage ImageItem3;
	CImage ImageButton;
	CImage ImageBackGround;
	ImageItem1.LoadFromResource(hResInstance,IDB_KEYBOARD_ITEM1);
	ImageItem2.LoadFromResource(hResInstance,IDB_KEYBOARD_ITEM2);
	ImageItem3.LoadFromResource(hResInstance,IDB_KEYBOARD_ITEM3);
	ImageButton.LoadFromResource(hResInstance,IDB_BT_KEYBOARD_CLOSE);
	ImageBackGround.LoadFromResource(hResInstance,IDB_PASSWORD_KEYBORAD_BK);

	//渲染资源
	pSkinRenderManager->RenderImage(ImageItem1);
	pSkinRenderManager->RenderImage(ImageItem2);
	pSkinRenderManager->RenderImage(ImageItem3);
	pSkinRenderManager->RenderImage(ImageButton);
	pSkinRenderManager->RenderImage(ImageBackGround);

	//绘画背景
	ImageBackGround.BitBlt(BufferDC,0,0);

	//字符按钮
	for (INT nLine=0;nLine<CountArray(m_nItemCount);nLine++)
	{
		//绘画子项
		for (INT nRow=0;nRow<m_nItemCount[nLine];nRow++)
		{
			//计算位置
			INT nXImageIndex=0;
			INT nCharItemIndex=(nRow+m_nRandLine[nLine])%m_nItemCount[nLine];
			if ((m_wHoverLine==nLine)&&(m_wHoverRow==nRow)) nXImageIndex=(m_bMouseDown==false)?1:2;

			//绘画子项
			INT nXDrawPos=ITEM_POS_X+(m_SizeImageItem1.cx+ITEM_POS_S)*nRow;
			INT nYDrawPos=ITEM_POS_Y+(m_SizeImageItem1.cy+ITEM_POS_S)*nLine;
			ImageItem1.BitBlt(BufferDC,nXDrawPos,nYDrawPos,m_SizeImageItem1.cx,m_SizeImageItem1.cy,nXImageIndex*m_SizeImageItem1.cx,0);

			//构造颜色
			INT nColorIndex=0;
			COLORREF crTextColor[2]={RGB(0,0,0),RGB(125,125,125)};

			//颜色计算
			if (m_bShiftStatus==true) nColorIndex=(nColorIndex+1)%CountArray(crTextColor);
			if ((m_bCapsLockStatus==true)&&(nLine>=2)) nColorIndex=(nColorIndex+1)%CountArray(crTextColor);

			//绘画字符
			BufferDC.SetTextColor(crTextColor[nColorIndex]);
			BufferDC.TextOut(nXDrawPos+5,nYDrawPos+9,&m_szKeyboradChar[nLine][0][nCharItemIndex],1);

			//绘画字符
			BufferDC.SetTextColor(crTextColor[(nColorIndex+1)%CountArray(crTextColor)]);
			BufferDC.TextOut(nXDrawPos+15,nYDrawPos+3,&m_szKeyboradChar[nLine][1][nCharItemIndex],1);
		}
	}

	//退格按钮
	{
		//资源位置
		INT nXImageIndex=0;
		if ((m_wHoverLine==LINE_FUNCTION)&&(m_wHoverRow==ROW_BACK)) nXImageIndex=(m_bMouseDown==false)?1:2;

		//绘画背景
		INT nYDrawPos=ITEM_POS_Y;
		INT nXDrawPos=ITEM_POS_X+(m_SizeImageItem1.cx+ITEM_POS_S)*m_nItemCount[0];
		ImageItem3.BitBlt(BufferDC,nXDrawPos,nYDrawPos,m_SizeImageItem3.cx,m_SizeImageItem3.cy,nXImageIndex*m_SizeImageItem3.cx,0);

		//绘画字符
		BufferDC.SetTextColor(RGB(0,0,0));
		BufferDC.TextOut(nXDrawPos+20,ITEM_POS_Y+7,TEXT("←"),2);
	}

	//切换按钮
	{
		//资源位置
		INT nXImageIndex=(m_bShiftStatus==true)?1:0;
		if ((m_wHoverLine==LINE_FUNCTION)&&(m_wHoverRow==ROW_SHIFT)) nXImageIndex=(m_bMouseDown==false)?1:2;

//.........这里部分代码省略.........
开发者ID:lonyzone,项目名称:oathx-ogrex-editor,代码行数:101,代码来源:PasswordControl.cpp


注:本文中的CImage::BitBlt方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。