?? display.h
字號:
#ifndef __DISPLAY_H__
#define __DISPLAY_H__
#include "figure.h"
#define FONTSIZE_SMALL 1
#define FONTSIZE_MIDDLE 2
#define FONTSIZE_BIG 3
#define FONT_TRANSPARENT 4 //透明背景
#define FONT_BLACKBK 8 //黑底白字
#define GRAPH_MODE_NORMAL 0x00 //普通繪圖模式
#define GRAPH_MODE_OR 0x10 //繪圖模式 或
#define GRAPH_MODE_AND 0x20 //繪圖模式 與
#define GRAPH_MODE_XOR 0x30 //繪圖模式 異或
#define GRAPH_MODE_NOR 0x40 //繪圖模式 或非
#define COLOR_BLACK 0 //黑色前景色
#define COLOR_WHITE 0xffffffff //白色前景色
#define GRAPH_ARC_BACKWARD 0 //逆時針畫圓
#define GRAPH_ARC_FORWARD 1 //順時針畫圓
#define GRAPH_3D_UP 0 //突起的3D矩形框
#define GRAPH_3D_DOWN 1 //凹陷的3D矩形框
//***********************************************/
#define TEXTOUT_MID_X 1
#define TEXTOUT_MID_Y 2
typedef struct tagBITMAPFILEHEADER {
U32 bfSize;
U32 bfReserved12;
U32 bfOffBits;
} BITMAPFILEHEADER, *PBITMAPFILEHEADER;
typedef struct tagBITMAPINFOHEADER {
U32 biSize;
U32 biWidth;
U32 biHeight;
U16 biPlanes;
U16 biBitCount;
U32 biCompression;
U32 biSizeImage;
U32 biXPelsPerMeter;
U32 biYPelsPerMeter;
U32 biClrUsed;
U32 biClrImportant;
} BITMAPINFOHEADER;
typedef U32 COLORREF;
//定義繪圖設備結構
typedef struct{
int DrawPointx;
int DrawPointy; //繪圖所使用的坐標點
int PenWidth; //畫筆寬度
U32 PenMode; //畫筆模式
COLORREF PenColor; //畫筆的顏色
int DrawOrgx; //繪圖的坐標原點位置
int DrawOrgy;
int WndOrgx; //繪圖的窗口坐標位置
int WndOrgy;
int DrawRangex; //繪圖的區域范圍
int DrawRangey;
structRECT DrawRect;//繪圖的有效范圍
U8 bUpdataBuffer; //是否更新后臺緩沖區及顯示
U32 Fontcolor; //字符顏色
}DC, * PDC;
#define RGB(r,g,b) (((r)<<16)|((g)<<8)|(b))
void initOSDC();
PDC CreateDC();
void DestoryDC(PDC pdc);
void SetPixel(PDC pdc, int x, int y, COLORREF color);
void SetPixelOR(PDC pdc,int x, int y, COLORREF color);
void SetPixelAND(PDC pdc,int x, int y, COLORREF color);
void SetPixelXOR(PDC pdc, int x, int y, COLORREF color);
int GetFontHeight(U8 fnt);
void TextOut(PDC pdc,int x, int y, U16 *ch, U8 bunicode, U8 fnt); //顯示文字
void TextOutRect(PDC pdc, structRECT* prect, U16* ch, U8 bunicode, U8 fnt, U32 outMode); //在指定矩形的范圍內顯示文字
void MoveTo(PDC pdc, int x, int y);
void LineTo(PDC pdc, int x, int y);
void DrawRectFrame(PDC pdc, int left,int top ,int right, int bottom);
void DrawRectFrame2(PDC pdc, structRECT *rect);
void FillRect(PDC pdc, int left,int top ,int right, int bottom,U32 DrawMode, U32 color);
void FillRect2(PDC pdc, structRECT *rect,U32 DrawMode, U32 color);
void ClearScreen();
U8 SetPenWidth(PDC pdc, U8 width);
U32 SetPenMode(PDC pdc, U32 mode);
void Circle(PDC pdc, int x0, int y0, int r);
int Getdelta1(int x0,int y0, int R);
int Getdelta2(int x0,int y0, int R);
void ArcTo1(PDC pdc, int x1, int y1, int R);
void ArcTo2(PDC pdc, int x1, int y1, int R);
void ArcTo(PDC pdc, int x1, int y1, U8 arctype, int R);
//void ArcTo(int x1,int y1, U8 arctype, int cenx,int ceny);
U8 SetLCDUpdata(PDC pdc, U8 isUpdata);
void Draw3DRect(PDC pdc, int left,int top, int right, int botton, COLORREF color1, COLORREF color2);
void Draw3DRect2(PDC pdc, structRECT *rect, COLORREF color1, COLORREF color2);
U8 GetPenWidth(PDC pdc);
U32 GetPenMode(PDC pdc);
U32 SetPenColor(PDC pdc, U32 color);
U32 GetPenColor(PDC pdc);
void GetBmpSize(char filename[], int* Width, int *Height);
void ShowBmp(PDC pdc, char filename[], int x, int y);
void SetDrawOrg(PDC pdc, int x,int y, int* oldx, int *oldy);//設置繪圖的原點
void SetDrawRange(PDC pdc, int x,int y, int* oldx, int *oldy);//設置繪圖的范圍
////////////////////有延時繪圖/////////////////
void LineToDelay(PDC pdc, int x, int y, int ticks);
void ArcToDelay(PDC pdc, int x1, int y1, U8 arctype, int R, int ticks);
#endif
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -