clientcapture.h

来自「VC++编程百例」· C头文件 代码 · 共 62 行

H
62
字号
/////////////////////////////////////////////////////////////////////////////
// Copyright (C) 1998 by Andrew Bryan
// All rights reserved
//
// Send bug reports, bug fixes, enhancements, requests, etc. to:
//    abtb@ix.netcom.com
/////////////////////////////////////////////////////////////////////////////
//
// ClientCapture.h : interface of the CClientCapture class
//
// Much of this code is altered cut and pastes of other people's
// source (where they got them...I don't know but have seen very
// similar pieces from Microsoft).
//	
// I cannot find the original code pieces but I do know the one 
// author from which I used code is Zafir Anjum.
//
/////////////////////////////////////////////////////////////////////////////

#if !defined(AFX_CLIENTCAPTURE_H__F3017F4D_3A97_11D2_9506_F6C490433B31__INCLUDED_)
#define AFX_CLIENTCAPTURE_H__F3017F4D_3A97_11D2_9506_F6C490433B31__INCLUDED_

#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000


class CClientCapture 
{
public: // create from serialization only
	CClientCapture();
	~CClientCapture();
// Operations
public:
	void Release();
	BOOL WriteDIB( CString csFile);
	void OnDraw(HDC hDC, CRect rcRect, CRect rect);
	BOOL Paint(HDC hDC, CPalette *pal, LPRECT lpDCRect, LPRECT lpDIBRect) const;
	void Capture(CDC *dc, CRect rectDIB);

private:
	HANDLE hDIB;
	
	DWORD Height() const;
	BOOL WriteWindowToDIB( HDC hDC, CDC* dc, CRect rect);
	HANDLE DDBToDIB( CBitmap& bitmap, DWORD dwCompression, CPalette* pPal, CDC* dc);

	BOOL WriteWindowToDIB(CDC* dc, CRect rect);

	LPBITMAPINFO m_pBMI;
	LPBYTE 	m_pBits;
	CPalette pal;
	

};

/////////////////////////////////////////////////////////////////////////////
#endif // !defined(AFX_CLIENTCAPTURE_H__F3017F4D_3A97_11D2_9506_F6C490433B31__INCLUDED_)



⌨️ 快捷键说明

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