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


C++ LPDIRECT3DSURFACE9::ReleaseDC方法代码示例

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


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

示例1: print_info

    void print_info(LPDIRECT3DSURFACE9 pSurface, int mode, float time, cv::String oclDevName)
    {
        HDC hDC;

        HRESULT r = pSurface->GetDC(&hDC);
        if (FAILED(r))
        {
            return;
        }

        HFONT hFont = (HFONT)::GetStockObject(SYSTEM_FONT);

        HFONT hOldFont = (HFONT)::SelectObject(hDC, hFont);

        if (hOldFont)
        {
            TEXTMETRIC tm;
            ::GetTextMetrics(hDC, &tm);

            char buf[256];
            int  y = 0;

            buf[0] = 0;
            sprintf(buf, "mode: %s", m_modeStr[mode].c_str());
            ::TextOut(hDC, 0, y, buf, (int)strlen(buf));

            y += tm.tmHeight;
            buf[0] = 0;
            sprintf(buf, m_demo_processing ? "blur frame" : "copy frame");
            ::TextOut(hDC, 0, y, buf, (int)strlen(buf));

            y += tm.tmHeight;
            buf[0] = 0;
            sprintf(buf, "time: %4.1f msec", time);
            ::TextOut(hDC, 0, y, buf, (int)strlen(buf));

            y += tm.tmHeight;
            buf[0] = 0;
            sprintf(buf, "OpenCL device: %s", oclDevName.c_str());
            ::TextOut(hDC, 0, y, buf, (int)strlen(buf));

            ::SelectObject(hDC, hOldFont);
        }

        r = pSurface->ReleaseDC(hDC);

        return;
    } // print_info()
开发者ID:Jendker,项目名称:opencv,代码行数:48,代码来源:d3d9_interop.cpp

示例2: TranslateColor

COLORREF CAnimationSpooler::TranslateColor(LPDIRECT3DSURFACE9 pSurface, COLORREF clrColor) const
{
   ASSERT(pSurface);
   if( clrColor == CLR_INVALID ) return clrColor;
   // The only way to actually determine what color a certain RGB value gets, is
   // to put a pixel on the surface and taste it.
   HDC hDC = NULL;
   HRESULT Hr = pSurface->GetDC(&hDC);
   if( FAILED(Hr) ) return false;
   COLORREF clrOld = ::GetPixel(hDC, 0, 0);
   ::SetPixel(hDC, 0, 0, clrColor);
   clrColor = ::GetPixel(hDC, 0,0);
   ::SetPixel(hDC, 0, 0, clrOld);
   pSurface->ReleaseDC(hDC);
   return clrColor;
}
开发者ID:3rdexp,项目名称:xsandbox,代码行数:16,代码来源:UIAnim.cpp

示例3: LcD3D_DrawTextBackbuffer

INT LcD3D_DrawTextBackbuffer(PDEV pDev, INT X, INT Y, LPCTSTR Text, DWORD _color)
{
	HDC hDC=0;
	LPDIRECT3DSURFACE9 Surface;

	if(FAILED(pDev->GetBackBuffer(0, 0, D3DBACKBUFFER_TYPE_MONO, &Surface)))
		return -1;

	Surface->GetDC(&hDC);

	if(NULL != hDC)
	{
		SetBkMode(hDC, TRANSPARENT);
		SetTextColor(hDC, _color);
		TextOut(hDC, X, Y, Text, strlen(Text));

		Surface->ReleaseDC(hDC);
	}

	Surface->Release(); //해제한다.


	return 0;
}
开发者ID:GALICSOFT,项目名称:glc220_src,代码行数:24,代码来源:LnUtilDx.cpp


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