Click here to Skip to main content
Click here to Skip to main content
Add your own
alternative version

Various methods for capturing the screen

, 19 Sep 2006 LGPL3
Explains techniques for capturing the screen programmatically.
screencap.zip
ScreenCap
ico00001.ico
icon1.ico
Release
ScreenCap.exe
ScreenCap.ico
ScreenCap.vcproj.vspscc
ScreenCap.vssscc
small.ico
screencapdx.zip
ScreenCapDx
ico00001.ico
icon1.ico
Release
ScreenCapture.exe
ScreenCapture.7.10.vssscc
ScreenCapture.ico
ScreenCapture.vcproj.vspscc
ScreenCapture.vssscc
small.ico
wmencscrncap.zip
Release
WMEncScrnCap.exe
ico00001.ico
icon1.ico
icon_sta.ico
small.ico
WMEncScrnCap.ico
#pragma once

#ifndef __AVIFILE_H
#define __AVIFILE_H

#include <vfw.h>

class CAviFile
{
	HDC				m_hAviDC;
	HANDLE			m_hHeap;
	LPVOID			m_lpBits;
	LONG			m_lSample;
	TCHAR			m_szFileName[MAX_PATH];
	PAVIFILE		m_pAviFile;
	PAVISTREAM		m_pAviStream;
	PAVISTREAM		m_pAviCompressedStream;
	AVISTREAMINFO	m_AviStreamInfo;
	AVICOMPRESSOPTIONS	m_AviCompressOptions;

	int		nAppendFuncSelector;		//0=Dummy	1=FirstTime	2=Usual
	HRESULT	AppendFrameFirstTime(HBITMAP );
	HRESULT	AppendFrameUsual(HBITMAP);
	HRESULT	AppendDummy(HBITMAP);
	HRESULT	(CAviFile::*pAppendFrame[3])(HBITMAP hBitmap);

	HRESULT	AppendFrameFirstTime(int, int, LPVOID,int );
	HRESULT	AppendFrameUsual(int, int, LPVOID,int );
	HRESULT	AppendDummy(int, int, LPVOID,int );
	HRESULT	(CAviFile::*pAppendFrameBits[3])(int, int, LPVOID,int );
	void	ReleaseMemory();
public:
	CAviFile(LPCSTR	lpszFileName=_T("Output.avi"));
	~CAviFile(void);
	HRESULT	AppendNewFrame(HBITMAP hBitmap);
	HRESULT	AppendNewFrame(int nWidth, int nHeight, LPVOID pBits,int nBitsPerPixel=32);
};

#endif

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The GNU Lesser General Public License (LGPLv3)

Share

About the Author

Creator of CarMusTy - Carnatic Music Typesetting Application, and the CFugue C++ Runtime Environment for MusicNote Programming.

| Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.141223.1 | Last Updated 19 Sep 2006
Article Copyright 2003 by Gopalakrishna Palem
Everything else Copyright © CodeProject, 1999-2014
Layout: fixed | fluid