⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 gc.cpp

📁 通过同步软件来获取移动智能设备屏幕画面
💻 CPP
字号:
// GC.cpp: implementation of the CGC class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "GC.h"


#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

CGC::CGC()
:	m_bOpen	(FALSE),
	m_pBuf	(NULL)
{
	
}


CGC::~CGC()
{
	Close();
}


int CGC::Open(HWND hWnd)
{
	int	nRval = 0;

	if(m_bOpen)
		return -1;

	nRval = GXOpenDisplay(hWnd, GX_FULLSCREEN);
	if(nRval != 0)
	{
		m_bOpen = TRUE;
		m_dp = GXGetDisplayProperties();
	}
	return nRval;
}


int CGC::Close()
{
	int nRval = 0;
	
	if(m_pBuf)
		EndDraw();

	if(m_bOpen)
	{
		nRval	= GXCloseDisplay();
		m_bOpen	= FALSE;
	}
	return nRval;
}


WORD CGC::ConvertRGB(COLORREF cr)
{
	WORD	w = 0;

	if(m_dp.ffFormat & kfDirect565)
		w = (GetRValue(cr) / 8) << 11 | (GetGValue(cr) / 8) << 6 | (GetBValue(cr) / 8);
	else if(m_dp.ffFormat & kfDirect555)
		w = (GetRValue(cr) / 8) << 11 | (GetGValue(cr) / 8) << 5 | (GetBValue(cr) / 8);

	return w;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -