📄 textout.h
字号:
//
// Textout
// 2008/1/3 by lnh
#ifndef __TEXTOUT_H__
#define __TEXTOUT_H__
// 5 ,6 ,5
// 32,64,32
//#define RGB(r,g,b) ((b&31)+((g&63)<<5)+((r&31)<<11))
#define RGB(r,g,b) ((b*31.0/255)+((int)(g*63.0/255)<<5)+((int)(r*31.0/255)<<11))
//BGR565
// return (r&31)+((g&63)<<5)+((b&31)<<11);
//RGB565
// return (b&31)+((g&63)<<5)+((r&31)<<11);
#define COLOR_RED RGB(255,0,0)
#define COLOR_GREEN RGB(0,255,0)
#define COLOR_BLUE RGB(0,0,255)
#define COLOR_BLACK RGB(0,0,0)
#define COLOR_WHITE RGB(255,255,255)
#define COLOR_LightGrey RGB(0xd3,0xd3,0xd3)
#define COLOR_Siver RGB(192,192,192)
#define COLOR_WIN2000 RGB(45,150,255)
#define TM_TRANSPARENT 0
#define TM_HALFTRANSPARENT 1
#define TM_NOTTRANSPARENT 2
#define TM_HALFTRANSPARENT2 3
#define FONT_WIDTH 8
#define FONT_HEIGHT 16
void ResetTextOut(void);
void TextOut(int x,int y,const char* ptext);
void FillEnChar8x16(int x,int y,unsigned char ch);
void FillChChar16x16(int x,int y,unsigned short ch);
extern unsigned int gi_CurrentTextColor;
extern unsigned int gi_CurrentBkColor;
extern unsigned int gi_CurrentTextMode;
extern unsigned char gi_HoriEnlarge;
extern unsigned char gi_VertEnlarge;
#define SetTextColor(textcolor) gi_CurrentTextColor = textcolor
#define SetBkColor(bkcolor) gi_CurrentBkColor = bkcolor
#define SetTextMode(textmode) gi_CurrentTextMode = textmode
#define SetHoriEnlarge(hori) gi_HoriEnlarge = hori
#define SetVertEnlarge(vert) gi_VertEnlarge = vert
#define GetVertEnlarge() gi_VertEnlarge
void FillRect(int x,int y,int w,int h,int c);
void Rectangle(int x,int y,int w,int h,int c);
void Line(int fx,int fy,int tx,int ty,int c);
void RestoreDesktopRect(int x,int y,int w,int h);
extern unsigned char gec_logo[];
void Paint_SmallLogo(int x0,int y0);
//#define BMP_DESKTOP
#define DesktopPixel(x,y) ((gec_logo[(y)*SW*2+(x)*2]<<8)|gec_logo[(y)*SW*2+(x)*2+1])
#define Paint_Desktop() Paint_Bmp(0, 0, 800, 480, gec_logo)
#ifdef BMP_DESKTOP
#define RestoreDesktop() Paint_Desktop()
#define GetDesktopPixel(x,y) DesktopPixel(x,y)
#else
__inline void RestoreDesktop(void)
{
#if 0
int i;
for(i = 0; i < 480; i+=20)
{
Paint_Bmp(0, i, 800,20, gec_logo+460*800*2);
}
#else
extern void restore_desktop(void);
restore_desktop();
#endif
}
//#define RestoreDesktop() FillRect(0,0,SW,SH,COLOR_Siver)
#define GetDesktopPixel(x,y) (COLOR_Siver)
#endif
#ifdef BMP_DESKTOP
#define DisableUpdate(x0,y0,x1,y1)
#define EnableUpdate(x0,y0,x1,y1)
#else
extern unsigned short LCD_BUFER[480][800];
extern unsigned short* plcdbuffer;
#include <string.h>
extern void CopyLcdBuffer(void* newptr,int x0,int y0,int x1,int y1);
__inline void DisableUpdate(int x0,int y0,int x1,int y1)
{
CopyLcdBuffer(&gec_logo,x0,y0,x1,y1);
}
__inline void EnableUpdate(int x0,int y0,int x1,int y1)
{
CopyLcdBuffer(&LCD_BUFER[0][0],x0,y0,x1,y1);
}
#endif
#endif // __TEXTOUT_H__
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -