亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? pictureex.h

?? 網絡游戲建模書的源代碼
?? H
字號:
//////////////////////////////////////////////////////////////////////
// PictureEx.cpp: implementation of the CPictureEx class.
//
// Picture displaying control with support for the following formats:
// GIF (including animated GIF87a and GIF89a), JPEG, BMP, WMF, ICO, CUR
// 
// Written by Oleg Bykov (oleg_bykoff@rsdn.ru)
// Copyright (c) 2001
//
// To use CPictureEx, follow these steps:
//   - place a static control on your dialog (either a text or a bitmap)
//   - change its identifier to something else (e.g. IDC_MYPIC)
//   - associate a CStatic with it using ClassWizard
//   - in your dialog's header file replace CStatic with CPictureEx
//     (don't forget to #include "PictureEx.h" and add 
//     PictureEx.h and PictureEx.cpp to your project)
//   - call one of the overloaded CPictureEx::Load() functions somewhere
//     (OnInitDialog is a good place to start)
//   - if the preceding Load() succeeded call Draw()
//  
// You can also add the control by defining a member variable of type 
// CPictureEx, calling CPictureEx::Create (derived from CStatic), then 
// CPictureEx::Load and CPictureEx::Draw.
//
// By default, the control initializes its background to COLOR_3DFACE
// (see CPictureEx::PrepareDC()). You can change the background by
// calling CPictureEx::SetBkColor(COLORREF) after CPictureEx::Load().
//
// I decided to leave in the class the functions to write separate frames from 
// animated GIF to disk. If you want to use them, uncomment #define GIF_TRACING 
// and an appropriate section in CPictureEx::Load(HGLOBAL, DWORD). These functions 
// won't be compiled and linked to your project unless you uncomment #define GIF_TRACING,
// so you don't have to worry.
// 
// Warning: this code hasn't been subject to a heavy testing, so
// use it on your own risk. The author accepts no liability for the 
// possible damage caused by this code.
//
// Version 1.0  7 Aug 2001
//              Initial release
//
// Version 1.1  6 Sept 2001
//              ATL version of the class
//
// Version 1.2  14 Oct 2001
//              - Fixed a problem with loading GIFs from resources
//                in MFC-version of the class for multi-modules apps.
//                Thanks to Ruben Avila-Carretero for finding this out.
//
//              - Got rid of waitable timer in ThreadAnimation()
//                Now CPictureEx[Wnd] works in Win95 too.
//                Thanks to Alex Egiazarov and Wayne King for the idea.
//
//              - Fixed a visual glitch of using SetBkColor.
//                Thanks to Kwangjin Lee for finding this out.
//
// Version 1.3  10 Nov 2001
//              - Fixed a DC leak. One DC leaked per each UnLoad()
//                (forgot to put a ReleaseDC() in the end of 
//                CPictureExWnd::PrepareDC() function).
//
//              - Now it is possible to set a clipping rectangle using
//                CPictureEx[Wnd]::SetPaintRect(const LPRECT) function.
//                The LPRECT parameter tells the class what portion of
//                a picture should it display. If the clipping rect is 
//                not set, the whole picture is shown.
//                Thanks to Fabrice Rodriguez for the idea.
//
//              - Added support for Stop/Draw. Now you can Stop() an
//                animated GIF, then Draw() it again, it will continue
//                animation from the frame it was stopped on. You can 
//                also know if a GIF is currently playing with the 
//                IsPlaying() function.
//             
//              - Got rid of math.h and made m_bExitThread volatile. 
//                Thanks to Piotr Sawicki for the suggestion.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_PICTUREEX_H__0EFE5DE0_7B68_4DB7_8B34_5DC634948438__INCLUDED_)
#define AFX_PICTUREEX_H__0EFE5DE0_7B68_4DB7_8B34_5DC634948438__INCLUDED_

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

#include <vector>

//#define GIF_TRACING  // uncomment it if you want detailed TRACEs

class CPictureEx : public CStatic
{
public:

struct TFrame    // structure that keeps a single frame info
{
	IPicture *m_pPicture;  // pointer to the interface used for drawing
	SIZE     m_frameSize;
	SIZE     m_frameOffset;
	UINT     m_nDelay;     // delay (in 1/100s of a second)
	UINT     m_nDisposal;  // disposal method
};

#pragma pack(1)   // turn byte alignment on

enum GIFBlockTypes
{
	BLOCK_UNKNOWN,
	BLOCK_APPEXT,
	BLOCK_COMMEXT,
	BLOCK_CONTROLEXT,
	BLOCK_PLAINTEXT,
	BLOCK_IMAGE,
	BLOCK_TRAILER
};

enum ControlExtValues // graphic control extension packed field values
{
	GCX_PACKED_DISPOSAL,  // disposal method
	GCX_PACKED_USERINPUT,
	GCX_PACKED_TRANSPCOLOR
};

enum LSDPackedValues  // logical screen descriptor packed field values
{
	LSD_PACKED_GLOBALCT,
	LSD_PACKED_CRESOLUTION,
	LSD_PACKED_SORT,
	LSD_PACKED_GLOBALCTSIZE
};

enum IDPackedValues   // image descriptor packed field values
{
	ID_PACKED_LOCALCT,
	ID_PACKED_INTERLACE,
	ID_PACKED_SORT,
	ID_PACKED_LOCALCTSIZE
};

struct TGIFHeader       // GIF header  
{
	char m_cSignature[3]; // Signature - Identifies the GIF Data Stream
						  // This field contains the fixed value 'GIF'
	char m_cVersion[3];	// Version number. May be one of the following:
						// "87a" or "89a"
};

struct TGIFLSDescriptor // Logical Screen Descriptor
{
	WORD m_wWidth;	// 2 bytes. Logical screen width
	WORD m_wHeight; // 2 bytes. Logical screen height

	unsigned char m_cPacked;      // packed field	

	unsigned char m_cBkIndex;     // 1 byte. Background color index
	unsigned char m_cPixelAspect; // 1 byte. Pixel aspect ratio
	inline int GetPackedValue(enum LSDPackedValues Value);
};

struct TGIFAppExtension // application extension block
{
	unsigned char m_cExtIntroducer; // extension introducer (0x21)
	unsigned char m_cExtLabel; // app. extension label (0xFF)
	unsigned char m_cBlockSize; // fixed value of 11
	char m_cAppIdentifier[8];   // application identifier
	char m_cAppAuth[3];  // application authentication code
};

struct TGIFControlExt // graphic control extension block
{
	unsigned char m_cExtIntroducer; // extension introducer (0x21)
	unsigned char m_cControlLabel;  // control extension label (0xF9)
	unsigned char m_cBlockSize; // fixed value of 4
	unsigned char m_cPacked;    // packed field
	WORD m_wDelayTime;	// delay time
	unsigned char m_cTColorIndex; // transparent color index
	unsigned char m_cBlockTerm;   // block terminator (0x00)
public:
	inline int GetPackedValue(enum ControlExtValues Value);
};

struct TGIFCommentExt  // comment extension block
{
	unsigned char m_cExtIntroducer; // extension introducer (0x21)
	unsigned char m_cCommentLabel;  // comment extension label (0xFE)
};

struct TGIFPlainTextExt // plain text extension block
{
	unsigned char m_cExtIntroducer;  // extension introducer (0x21)
	unsigned char m_cPlainTextLabel; // text extension label (0x01)
	unsigned char m_cBlockSize; // fixed value of 12
	WORD m_wLeftPos;    // text grid left position
	WORD m_wTopPos;     // text grid top position
	WORD m_wGridWidth;  // text grid width
	WORD m_wGridHeight; // text grid height
	unsigned char m_cCellWidth;  // character cell width
	unsigned char m_cCellHeight; // character cell height
	unsigned char m_cFgColor; // text foreground color index
	unsigned char m_cBkColor; // text background color index
};

struct TGIFImageDescriptor // image descriptor block
{
	unsigned char m_cImageSeparator; // image separator byte (0x2C)
	WORD m_wLeftPos; // image left position
	WORD m_wTopPos;  // image top position
	WORD m_wWidth;   // image width
	WORD m_wHeight;  // image height
	unsigned char m_cPacked; // packed field
	inline int GetPackedValue(enum IDPackedValues Value);
};

#pragma pack() // turn byte alignment off

public:
	BOOL GetPaintRect(RECT *lpRect);
	BOOL SetPaintRect(const RECT *lpRect);
	CPictureEx();
	virtual ~CPictureEx();
	void Stop();   // stops animation
	void UnLoad(); // stops animation plus releases all resources

	BOOL IsGIF() const;
	BOOL IsPlaying() const;
	BOOL IsAnimatedGIF() const;
	SIZE GetSize() const;
	int GetFrameCount() const;
	COLORREF GetBkColor() const;
	void SetBkColor(COLORREF clr);

	// draws the picture (starts an animation thread if needed)
	// if an animation was previously stopped by Stop(),
	// continues it from the last displayed frame
	BOOL Draw();

	// loads a picture from a file
	// i.e. Load(_T("mypic.gif"));
	BOOL Load(LPCTSTR szFileName);

	// loads a picture from a global memory block (allocated by GlobalAlloc)
	// Warning: this function DOES NOT free the global memory, pointed to by hGlobal
	BOOL Load(HGLOBAL hGlobal, DWORD dwSize);

	// loads a picture from a program resource
	// i.e. Load(MAKEINTRESOURCE(IDR_MYPIC),_T("GIFTYPE"));
	BOOL Load(LPCTSTR szResourceName,LPCTSTR szResourceType);

protected:

#ifdef GIF_TRACING
	void EnumGIFBlocks();
	void WriteDataOnDisk(CString szFileName, HGLOBAL hData, DWORD dwSize);
#endif // GIF_TRACING

	RECT m_PaintRect;
	SIZE m_PictureSize;
	COLORREF m_clrBackground;
	UINT m_nCurrFrame;
	UINT m_nDataSize;
	UINT m_nCurrOffset;
	UINT m_nGlobalCTSize;
	BOOL m_bIsGIF;
	BOOL m_bIsPlaying;
	volatile BOOL m_bExitThread;
	BOOL m_bIsInitialized;
	HDC m_hMemDC;

	HDC m_hDispMemDC;
	HBITMAP m_hDispMemBM;
	HBITMAP m_hDispOldBM;

	HBITMAP m_hBitmap;
	HBITMAP m_hOldBitmap;
	HANDLE m_hThread;
	HANDLE m_hExitEvent;
	IPicture * m_pPicture;
	TGIFHeader * m_pGIFHeader;
	unsigned char * m_pRawData;
	TGIFLSDescriptor * m_pGIFLSDescriptor;
	std::vector<TFrame> m_arrFrames;

	void ThreadAnimation();
	static UINT WINAPI _ThreadAnimation(LPVOID pParam);

	int GetNextBlockLen() const;
	BOOL SkipNextBlock();
	BOOL SkipNextGraphicBlock();
	BOOL PrepareDC(int nWidth, int nHeight);
	void ResetDataPointer();
	enum GIFBlockTypes GetNextBlock() const;
	UINT GetSubBlocksLen(UINT nStartingOffset) const;
	HGLOBAL GetNextGraphicBlock(UINT *pBlockLen, UINT *pDelay, 
		SIZE *pBlockSize, SIZE *pBlockOffset, UINT *pDisposal);

	// Generated message map functions
	//{{AFX_MSG(CPictureEx)
	afx_msg void OnDestroy();
	afx_msg void OnPaint();
	//}}AFX_MSG
	
	DECLARE_MESSAGE_MAP()
};

#endif // !defined(AFX_PICTUREEX_H__0EFE5DE0_7B68_4DB7_8B34_5DC634948438__INCLUDED_)

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
激情图区综合网| 另类人妖一区二区av| 日韩精品一区二区三区四区| 欧美午夜一区二区三区免费大片| 成人免费福利片| 成人av网站免费观看| 国产白丝网站精品污在线入口| 青青草成人在线观看| 日本成人在线视频网站| 美女任你摸久久| 国产一区二区三区在线观看精品| 美女一区二区在线观看| 狠狠色综合日日| 国产精品456| 99re这里只有精品视频首页| 色爱区综合激月婷婷| 在线观看91精品国产入口| 日本二三区不卡| 6080国产精品一区二区| 日韩一区二区三区电影在线观看| 欧美本精品男人aⅴ天堂| 国产亚洲一区二区三区在线观看| 国产精品美女久久久久aⅴ| 亚洲欧美日韩一区二区| 日本一区中文字幕| 国产成人亚洲精品狼色在线| 91麻豆国产香蕉久久精品| 欧美日韩视频一区二区| 精品欧美一区二区久久| 国产精品私人自拍| 亚洲国产视频直播| 激情久久五月天| 色婷婷综合五月| 欧美变态tickling挠脚心| 中文字幕在线免费不卡| 亚洲成人第一页| 激情综合亚洲精品| 一本色道久久综合精品竹菊| 91精品福利在线一区二区三区 | 欧美一级二级在线观看| 久久九九久精品国产免费直播| 日韩福利视频网| 成人一二三区视频| 91麻豆精品国产91久久久久久 | 99久久精品免费| 777欧美精品| 亚洲欧美偷拍卡通变态| 国产一区二三区| 91麻豆精品国产91久久久久久| 国产精品免费看片| 久久国产精品99久久久久久老狼 | 久久精品国产澳门| 欧美亚洲丝袜传媒另类| 久久久久久久久久久久电影| 亚洲v中文字幕| 日本大香伊一区二区三区| 欧美国产国产综合| 麻豆国产91在线播放| 欧美体内she精视频| 国产精品伦理在线| 韩日av一区二区| 欧美一卡2卡三卡4卡5免费| 一级中文字幕一区二区| av色综合久久天堂av综合| 国产无一区二区| 久久精品国产一区二区三区免费看| 色婷婷亚洲一区二区三区| 欧美激情在线观看视频免费| 国产麻豆视频精品| 2021久久国产精品不只是精品| 五月天视频一区| 欧美少妇性性性| 日韩综合小视频| 毛片av一区二区| 7777精品久久久大香线蕉| 亚洲少妇最新在线视频| av一区二区三区在线| 国产精品国模大尺度视频| 国产91精品免费| 久久久久亚洲综合| 国产很黄免费观看久久| 久久精品人人做人人爽人人| 韩国精品在线观看| 亚洲精品一区二区三区精华液 | 国产精品综合网| 国产欧美1区2区3区| 国产91精品在线观看| 亚洲欧美在线视频观看| 一本色道久久综合亚洲精品按摩| 亚洲少妇30p| 欧美日韩dvd在线观看| 午夜伦欧美伦电影理论片| 日韩欧美一区中文| 狠狠色丁香婷婷综合| 久久综合九色综合97_久久久| 成人免费高清在线| 亚洲色图视频网| 欧美精品1区2区| 黑人巨大精品欧美一区| 久久精品欧美一区二区三区不卡 | 亚洲成人动漫在线观看| 日韩三级在线观看| 国产一区二区电影| 亚洲视频一区二区在线| 欧美精品 国产精品| 久88久久88久久久| 中文字幕欧美一| 制服丝袜在线91| 国产成人av电影在线播放| 亚洲最新视频在线观看| 日韩久久久久久| 成人免费电影视频| 午夜欧美一区二区三区在线播放| 2023国产精品| 在线视频一区二区三| 激情深爱一区二区| 一个色综合av| 欧美国产精品一区二区三区| 欧美性猛片xxxx免费看久爱| 国产精品亚洲第一区在线暖暖韩国 | 亚洲国产日韩av| 欧美mv日韩mv| 色婷婷亚洲综合| 国产毛片精品一区| 视频一区二区三区入口| 中文字幕一区在线观看视频| 日韩一级欧美一级| 色综合久久久久久久久久久| 久久99国产乱子伦精品免费| 一区二区三区欧美| 亚洲国产精品二十页| 91精品国产色综合久久不卡电影 | 国产激情视频一区二区三区欧美| 亚洲国产一二三| 日韩理论片一区二区| 久久久激情视频| 日韩你懂的在线观看| 欧美日韩一区二区电影| 色视频欧美一区二区三区| 国产福利视频一区二区三区| 捆绑变态av一区二区三区| 亚洲妇熟xx妇色黄| 亚洲理论在线观看| 国产精品国产成人国产三级| 久久精品人人做人人爽人人| 2022国产精品视频| 精品国产区一区| 久久亚洲影视婷婷| 久久色中文字幕| 久久婷婷国产综合国色天香| 欧美一区二区精美| 日韩一区二区三区四区五区六区| 欧美日本韩国一区二区三区视频| 色素色在线综合| 欧美色综合网站| 欧美日韩不卡一区二区| 欧美日韩综合在线免费观看| 欧美专区亚洲专区| 欧美色窝79yyyycom| 欧美视频完全免费看| 欧美日韩二区三区| 91麻豆精品国产91久久久使用方法| 欧美精品第一页| 精品乱人伦一区二区三区| 精品福利在线导航| 国产精品欧美久久久久无广告 | 久久久一区二区| 欧美激情中文不卡| 亚洲理论在线观看| 亚洲午夜国产一区99re久久| 日韩成人dvd| 国产99久久久精品| 91色视频在线| 欧美一区二区网站| 久久午夜羞羞影院免费观看| 国产精品毛片大码女人| 玉足女爽爽91| 久久99热狠狠色一区二区| 国产99久久久国产精品免费看| 成人网在线免费视频| 在线视频一区二区三| 精品国产第一区二区三区观看体验| 久久久久国产精品麻豆ai换脸| 国产精品久久久久久久岛一牛影视 | 久久成人免费网站| 成人免费不卡视频| 欧美日韩日日摸| 久久久久久日产精品| 亚洲美女区一区| 麻豆视频观看网址久久| 大桥未久av一区二区三区中文| 日本高清免费不卡视频| 久久综合久久鬼色| 亚洲午夜羞羞片| 国产成人av自拍| 91麻豆精品国产| 亚洲视频一区二区免费在线观看| 日本成人在线看| 91精彩视频在线| 中文字幕不卡在线|