📄 memdev_printing.c
字号:
/*
*********************************************************************************************************
* uC/GUI
* Universal graphic software for embedded applications
*
* (c) Copyright 2002, Micrium Inc., Weston, FL
* (c) Copyright 2002, SEGGER Microcontroller Systeme GmbH
*
* 礐/GUI is protected by international copyright laws. Knowledge of the
* source code may not be used to write a similar product. This file may
* only be used in accordance with a license and should not be redistributed
* in any way. We appreciate your understanding and fairness.
*
----------------------------------------------------------------------
File : MEMDEV_Printing.c
Purpose : Demonstrates the use of GUI_MEMDEV_CreateFixed
----------------------------------------------------------------------
*/
#include "GUI.h"
#include <memory.h>
#ifndef GUI_CONST_STORAGE
#define GUI_CONST_STORAGE const
#endif
/********************************************************************
*
* Static data
*
*********************************************************************
*/
static const char * _acText[] = {
"Demonstrates how to use\n"
,"GUI_MEMDEV_CreateFixed() for printing"
};
/********************************************************************
*
* Static data, test picture 4bpp
*
*********************************************************************
*/
/* Palette
The following are the entries of the palette table.
Every entry is a 32-bit value (of which 24 bits are actually used)
the lower 8 bits represent the Red component,
the middle 8 bits represent the Green component,
the highest 8 bits (of the 24 bits used) represent the Blue component
as follows: 0xBBGGRR
*/
GUI_CONST_STORAGE GUI_COLOR ColorsTestPicture8[] = {
0xFFFFFF,0x0000FF,0x000000,0x00FFFF
,0xFF0000,0xFF1400,0xFF2800,0xFF3C00
,0xFF5000,0xFF6400,0xFF7800,0xFF8C00
,0xFFA000,0xFFB400,0xFFC800,0xFFDC00
,0xFFF000,0xFFFF00,0x2B40FF,0x2B55FF
,0x2B80FF,0x2B95FF,0x2BAAFF,0x2BBFFF
,0x2BD5FF
};
GUI_CONST_STORAGE GUI_LOGPALETTE PalTestPicture8 = {
25, /* number of entries */
0, /* Has transparency */
&ColorsTestPicture8[0]
};
GUI_CONST_STORAGE unsigned char acTestPicture8[] = {
0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
0x02, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
0x02, 0x01, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x01, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
0x02, 0x01, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x03, 0x01, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
0x02, 0x01, 0x03, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x03, 0x01, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
0x02, 0x01, 0x03, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10, 0x03, 0x01, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
0x02, 0x01, 0x03, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10, 0x11, 0x03, 0x01, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
0x02, 0x01, 0x03, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10, 0x11, 0x12, 0x03, 0x01, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
0x02, 0x01, 0x03, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10, 0x11, 0x12, 0x13, 0x03, 0x01, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
0x02, 0x01, 0x03, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10, 0x11, 0x12, 0x13, 0x14, 0x03, 0x01, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
0x02, 0x01, 0x03, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x03, 0x01, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
0x02, 0x01, 0x03, 0x0C, 0x0D, 0x0E, 0x0F, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x03, 0x01, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
0x02, 0x01, 0x03, 0x0D, 0x0E, 0x0F, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x03, 0x01, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
0x02, 0x01, 0x03, 0x0E, 0x0F, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x03, 0x01, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
0x02, 0x01, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x01, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
0x02, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02,
0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x02,
0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02,
0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x02,
0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02,
0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x02,
0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02
};
GUI_CONST_STORAGE GUI_BITMAP bmTestPicture8 = {
24, /* XSize */
24, /* YSize */
24, /* BytesPerLine */
8, /* BitsPerPixel */
acTestPicture8, /* Pointer to picture data (indices) */
&PalTestPicture8 /* Pointer to palette */
};
/********************************************************************
*
* Static data, test picture 4bpp
*
*********************************************************************
*/
GUI_CONST_STORAGE GUI_COLOR ColorsTestPicture4[] = {
0xFFFFFF,0x0000FF,0x000000,0x00FFFF
,0xFF8000,0xFF8080,0xFF0040,0x00FF00
,0xFFFF00,0x4080FF
};
GUI_CONST_STORAGE GUI_LOGPALETTE PalTestPicture4 = {
10, /* number of entries */
0, /* Has transparency */
&ColorsTestPicture4[0]
};
GUI_CONST_STORAGE unsigned char acTestPicture4[] = {
0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22,
0x21, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x20, 0x00, 0x00, 0x02,
0x21, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x31, 0x22, 0x22, 0x22, 0x22,
0x21, 0x34, 0x44, 0x44, 0x45, 0x55, 0x56, 0x31, 0x20, 0x00, 0x00, 0x02,
0x21, 0x34, 0x44, 0x45, 0x55, 0x56, 0x66, 0x31, 0x22, 0x22, 0x22, 0x22,
0x21, 0x34, 0x45, 0x55, 0x56, 0x66, 0x67, 0x31, 0x20, 0x00, 0x00, 0x02,
0x21, 0x35, 0x55, 0x56, 0x66, 0x67, 0x78, 0x31, 0x22, 0x22, 0x22, 0x22,
0x21, 0x35, 0x56, 0x66, 0x67, 0x77, 0x88, 0x31, 0x20, 0x00, 0x00, 0x02,
0x21, 0x36, 0x66, 0x67, 0x77, 0x78, 0x81, 0x31, 0x22, 0x22, 0x22, 0x22,
0x21, 0x36, 0x67, 0x77, 0x78, 0x88, 0x11, 0x31, 0x20, 0x00, 0x00, 0x02,
0x21, 0x37, 0x77, 0x78, 0x88, 0x81, 0x11, 0x31, 0x22, 0x22, 0x22, 0x22,
0x21, 0x37, 0x78, 0x88, 0x88, 0x11, 0x19, 0x31, 0x20, 0x00, 0x00, 0x02,
0x21, 0x38, 0x88, 0x88, 0x81, 0x11, 0x99, 0x31, 0x22, 0x22, 0x22, 0x22,
0x21, 0x38, 0x88, 0x88, 0x11, 0x19, 0x99, 0x31, 0x20, 0x00, 0x00, 0x02,
0x21, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x31, 0x22, 0x22, 0x22, 0x22,
0x21, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x20, 0x00, 0x00, 0x02,
0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22,
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, 0x02, 0x02, 0x02,
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22,
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, 0x02, 0x02, 0x02,
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22,
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, 0x02, 0x02, 0x02,
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22,
0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22
};
GUI_CONST_STORAGE GUI_BITMAP bmTestPicture4 = {
24, /* XSize */
24, /* YSize */
12, /* BytesPerLine */
4, /* BitsPerPixel */
acTestPicture4, /* Pointer to picture data (indices) */
&PalTestPicture4 /* Pointer to palette */
};
/********************************************************************
*
* Static data, test picture 2bpp
*
*********************************************************************
*/
GUI_CONST_STORAGE GUI_COLOR ColorsTestPicture2[] = {
0xFFFFFF,0xFF0000,0xFFFF00,0x000000
};
GUI_CONST_STORAGE GUI_LOGPALETTE PalTestPicture2 = {
4, /* number of entries */
0, /* Has transparency */
&ColorsTestPicture2[0]
};
GUI_CONST_STORAGE unsigned char acTestPicture2[] = {
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xD5, 0x55, 0x55, 0x55, 0xC0, 0x03,
0xDA, 0xAA, 0xAA, 0xA9, 0xFF, 0xFF,
0xDA, 0xAA, 0xAA, 0x99, 0xC0, 0x03,
0xDA, 0xAA, 0xA9, 0x59, 0xFF, 0xFF,
0xDA, 0xAA, 0x95, 0x59, 0xC0, 0x03,
0xDA, 0xA9, 0x55, 0x69, 0xFF, 0xFF,
0xDA, 0x95, 0x55, 0xA9, 0xC0, 0x03,
0xD9, 0x55, 0x56, 0x99, 0xFF, 0xFF,
0xD9, 0x55, 0x6A, 0x59, 0xC0, 0x03,
0xD9, 0x56, 0xA9, 0x59, 0xFF, 0xFF,
0xD9, 0x6A, 0xA5, 0x69, 0xC0, 0x03,
0xDA, 0xAA, 0x95, 0xA9, 0xFF, 0xFF,
0xDA, 0xAA, 0x56, 0xA9, 0xC0, 0x03,
0xDA, 0xAA, 0xAA, 0xA9, 0xFF, 0xFF,
0xD5, 0x55, 0x55, 0x55, 0xC0, 0x03,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xCC, 0xCC, 0xCC, 0xCC, 0xF3, 0x33,
0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCF,
0xCC, 0xCC, 0xCC, 0xCC, 0xF3, 0x33,
0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCF,
0xCC, 0xCC, 0xCC, 0xCC, 0xF3, 0x33,
0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF
};
GUI_CONST_STORAGE GUI_BITMAP bmTestPicture2 = {
24, /* XSize */
24, /* YSize */
6, /* BytesPerLine */
2, /* BitsPerPixel */
acTestPicture2, /* Pointer to picture data (indices) */
&PalTestPicture2 /* Pointer to palette */
};
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -