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


C++ ImageBase::DrawInternal方法代码示例

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


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

示例1: CreateCompatibleBitmap

	STDMETHOD(Draw)(DWORD dwAspect, LONG, void*, DVTARGETDEVICE*, HDC, 
		HDC hdc, LPCRECTL pRectBounds, LPCRECTL /* pRectWBounds */,
		BOOL (__stdcall *)(ULONG_PTR), ULONG_PTR) 
	{
		if (dwAspect != DVASPECT_CONTENT) return DV_E_DVASPECT;
		if (pRectBounds == NULL) return E_INVALIDARG;

		LoadSmiley();

		if (m_img == NULL) return E_FAIL;

		m_sizeExtent.cx = pRectBounds->right  - pRectBounds->left;
		m_sizeExtent.cy = pRectBounds->bottom - pRectBounds->top;

		m_rectExt = m_sizeExtent;

		switch (m_animtype) {
		case animDrctRichEd: 
			{
				m_rectExt.cy = pRectBounds->bottom - m_rectOrig.y;
				RECT frc = { 0, 0, m_sizeExtent.cx - 1, m_sizeExtent.cy - 1 };

				HBITMAP hBmp = CreateCompatibleBitmap(hdc, frc.right, frc.bottom);
				HDC hdcMem = CreateCompatibleDC(hdc);
				HANDLE hOld = SelectObject(hdcMem, hBmp);

				HBRUSH hbr = CreateSolidBrush(m_bkg); 
				FillRect(hdcMem, &frc, hbr);
				DeleteObject(hbr);

				m_img->DrawInternal(hdcMem, 0, 0, frc.right, frc.bottom);

				BitBlt(hdc, pRectBounds->left, pRectBounds->top, frc.right, frc.bottom, hdcMem, 0, 0, SRCCOPY);

				SelectObject(hdcMem, hOld);    
				DeleteObject(hBmp);	
				DeleteDC(hdcMem);
			}
			GetDrawingProp();
			break;

		case animHpp:
			m_orect = *(LPRECT)pRectBounds;

		default:
			m_img->DrawInternal(hdc, pRectBounds->left, pRectBounds->top, 
				m_sizeExtent.cx - 1, m_sizeExtent.cy - 1);
			break;
		}

		m_allowAni  = true;
		m_visible = true;

		return S_OK;
	}
开发者ID:0xmono,项目名称:miranda-ng,代码行数:55,代码来源:AniSmileyObject.cpp

示例2: DoDirectDraw

	void DoDirectDraw(HDC hdc)
	{
		HBITMAP hBmp = CreateCompatibleBitmap(hdc, m_rectExt.cx, m_rectExt.cy);
		HDC hdcMem = CreateCompatibleDC(hdc);
		HANDLE hOld = SelectObject(hdcMem, hBmp);

		RECT rc;
		rc.left   = m_rectExt.cx - m_sizeExtent.cx;
		rc.top    = m_rectExt.cy - m_sizeExtent.cy;
		rc.right  = rc.left + m_sizeExtent.cx;
		rc.bottom = rc.top + m_sizeExtent.cy;

		HBRUSH hbr = CreateSolidBrush(m_bkg); 
		RECT frc = { 0, 0, m_rectExt.cx, m_rectExt.cy };
		FillRect(hdcMem, &frc, hbr);
		DeleteObject(hbr);

		m_img->DrawInternal(hdcMem, rc.left, rc.top, m_sizeExtent.cx - 1, m_sizeExtent.cy - 1); 

		if (m_richFlags & REO_SELECTED) {
			HBRUSH hbr = CreateSolidBrush(m_bkg ^ 0xFFFFFF); 
			FrameRect(hdcMem, &rc, hbr);
			DeleteObject(hbr);
		}

		if (m_richFlags & REO_INVERTEDSELECT)
			InvertRect(hdcMem, &rc);

		BitBlt(hdc, m_rectOrig.x, m_rectOrig.y, m_rectExt.cx, m_rectExt.cy, hdcMem, 0, 0, SRCCOPY);

		SelectObject(hdcMem, hOld);    
		DeleteObject(hBmp);	
		DeleteDC(hdcMem);
	}
开发者ID:0xmono,项目名称:miranda-ng,代码行数:34,代码来源:AniSmileyObject.cpp


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