📄 hz.c
字号:
#include "string.h"
#include "fcntl.h"
#include "io.h"
#include "GUI.H"
#include "GProtect.h"
static int handle;
int OpenHZ(const char *Hz16Path)
{
return (handle=open(Hz16Path,O_BINARY));
}
int CloseHZ ()
{
if (handle<0) return -1;
else return close (handle);
}
int GetBit(unsigned char c,int n){
return((c>>n)&1);
}
int WriteHZ (int x, int y,const char *p,int color)
{
U16 c1,c2,rec;
long l;
char pixeldata[32];
int BytesPerLine;
GUI_DRAWMODE DrawMode = GUI_Context.TextMode;
GUI_DRAWMODE OldDrawMode;
if (handle<0 ) return 0;
if (p==NULL) return 0;
c1=(p[0]-0xa1)&0x07f;
c2=(p[1]-0xa1)&0x07f;
rec=c1*94+c2;
l=rec*32L;
lseek(handle,l,SEEK_SET);
read(handle,pixeldata,32);
BytesPerLine = 2;
OldDrawMode = LCD_SetDrawMode(DrawMode);
LCD_DrawBitmap (GUI_Context.DispPosX, GUI_Context.DispPosY,
HZSIZEX,HZSIZEY,
1, 1,
1, /*Bits per Pixel */
BytesPerLine,
(U8*)pixeldata,
NULL /* no palette means default palette */
);
/* Fill empty pixel lines */
/*
if (GUI_Context.pAFont->YDist > GUI_Context.pAFont->YSize) {
int YMag = GUI_Context.pAFont->YMag;
int YDist = GUI_Context.pAFont->YDist * YMag;
int YSize = GUI_Context.pAFont->YSize * YMag;
if (DrawMode != LCD_DRAWMODE_TRANS) {
LCD_COLOR OldColor = GUI_GetColor();
GUI_SetColor(GUI_GetBkColor());
LCD_FillRect(GUI_Context.DispPosX,
GUI_Context.DispPosY + YSize,
GUI_Context.DispPosX + pCharInfo->XSize,
GUI_Context.DispPosY + YDist);
GUI_SetColor(OldColor);
}
*/
LCD_SetDrawMode(OldDrawMode); /* Restore draw mode */
GUI_Context.DispPosX += HZSIZEX;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -