?? puthz.h
字號:
/////////////
// putHZ.h : v0011
// Written by : Liu Gang
// Compiler : Microsoft Visual C++ 4.0 & DirectX
// Library : DDraw.Lib
// Copyright (C) : 1996 WayAhead Corporation
// v0010 : Oct.4.1996
// v0011 : Apr.9.1997, change the name of GetSurface() to GetDDSurface()
// v0012 : Sep.2.1997, add an English version of PloyTextOut()
/////////////
// header file
#ifndef __PUTHZ_H__
#define __PUTHZ_H__
///////////////////
#include "DDApi.h"
#define CHAR_WIDTH 8
#define CHAR_HEIGHT 16
class CDDText
{
HDC myhdc;
SIZE m_bmpsize;
BYTE *m_mybytes;
HBITMAP myhbmpsec;
HGDIOBJ oldbmp;
RECT m_rcClient;
COLORREF m_textcolor;
DWORD m_dwColorCaps;
int m_nCol; // max charactor can be displayed
int m_nRow; // max line can be displayed
int m_nLineDist; // line distance
class CDDSurface m_Face;
public:
CDDText();
~CDDText();
//prepare for MyDrawText and MyTextOut
BOOL BeginText( int nCol, int nRow=1, BOOL bColorKey=TRUE );
//delete objects used by MyDrawText and MyTextOut
void EndText();
// set text color
void SetTextColor( COLORREF color ){m_textcolor = color;}
// set line distance
void SetLineDist( int nDist ){m_nLineDist = nDist;}
// get my surface
class CDDSurface * GetDDSurface(){return &m_Face;}
protected:
int ReadData( LPCTSTR string, int nLen );
// draw
public:
BOOL MyDrawText( LPDIRECTDRAWSURFACE2 pSurface, LPCTSTR lpszString, int len, LPRECT lpRect, UINT nFormat);
BOOL MyDrawText( LPDIRECTDRAWSURFACE2 pSurface, LPCTSTR lpszString, LPRECT lpRect, UINT nFormat);
BOOL MyTextOut( LPDIRECTDRAWSURFACE2 pSurface, int x, int y, LPCTSTR String, int len);
BOOL MyTextOut( LPDIRECTDRAWSURFACE2 pSurface, int x, int y, LPCTSTR String);
BOOL PolyTextOut( LPDIRECTDRAWSURFACE2 pSurface, int x, int y, const char *pString );
};
// 打開和關閉字庫
int HZ_OpenLib( char *filename );
void HZ_CloseLib();
///////////////////
#endif
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -