Repository navigation
Expand file tree
/
Copy pathrender.c
More file actions
619 lines (558 loc) · 19 KB
/
Copy pathrender.c
File metadata and controls
619 lines (558 loc) · 19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
#include <config.h>
#include <stdio.h>
#include <stdlib.h>
#include <render.h>
#include <file.h>
#include <fonts_manager.h>
#include <encoding_manager.h>
#include <picfmt_manager.h>
#include <string.h>
/**********************************************************************
* 函数名称: FlushVideoMemToDev
* 功能描述: 把缓冲区中的数据刷到显示设备上去,即在显示设备上显示缓冲区中的图像
* 输入参数: ptVideoMem - 缓冲区,内含象素数据
* 输出参数: 无
* 返 回 值: 0 - 成功, 其他值 - 失败
* 修改日期 版本号 修改人 修改内容
* -----------------------------------------------
* 2021/05/08 V1.0 张登雨 创建
***********************************************************************/
void FlushVideoMemToDev(PT_VideoMem ptVideoMem)
{
//memcpy(GetDefaultDispDev()->pucDispMem, ptVideoMem->tPixelDatas.aucPixelDatas, ptVideoMem.tPixelDatas.iHeight * ptVideoMem.tPixelDatas.iLineBytes);
if (!ptVideoMem->bDevFrameBuffer) {
GetDefaultDispDev()->ShowPage(ptVideoMem);
}
}
/**********************************************************************
* 函数名称: GetPixelDatasForIcon
* 功能描述: 取出BMP格式的图标文件中的象素数据
* 输入参数: strFileName - BMP格式的图标文件名,它位于/etc/digitpic/icons目录下
* 输出参数: ptPixelDatas - 内含象素数据,它所占的空间是通过malloc分配的,
* 不用时需要用FreePixelDatasForIcon来释放
* 返 回 值: 0 - 成功, 其他值 - 失败
* 修改日期 版本号 修改人 修改内容
* -----------------------------------------------
* 2021/05/08 V1.0 张登雨 创建
***********************************************************************/
int GetPixelDatasForIcon(char *strFileName, PT_PixelDatas ptPixelDatas)
{
T_FileMap tFileMap;
int iError;
int iXres, iYres, iBpp;
/* 图标存在 /etc/digitpic/icons */
snprintf(tFileMap.strFileName, 128, "%s/%s", ICON_PATH, strFileName);
tFileMap.strFileName[127] = '\0';
iError = MapFile(&tFileMap);
if (iError) {
DBG_PRINTF("MapFile %s error!\n", strFileName);
return -1;
}
//先判断是否支持bmp格式
iError = Parser("bmp")->isSupport(&tFileMap);
if (iError == 0) {
DBG_PRINTF("can't support this file: %s\n", strFileName);
UnMapFile(&tFileMap);
return -1;
}
GetDispResolution(&iXres, &iYres, &iBpp);
ptPixelDatas->iBpp = iBpp;
//支持的话就调用里面的解析函数进行解析
iError = Parser("bmp")->GetPixelDatas(&tFileMap, ptPixelDatas);
if (iError) {
DBG_PRINTF("GetPixelDatas for %s error!\n", strFileName);
UnMapFile(&tFileMap);
return -1;
}
UnMapFile(&tFileMap);
return 0;
}
/**********************************************************************
* 函数名称: FreePixelDatasForIcon
* 功能描述: 释放图像数据所占缓冲区
* 输入参数: ptPixelDatas - 内含象素数据,它所占的空间是通过malloc分配的
* 输出参数: 无
* 返 回 值: 0 - 成功, 其他值 - 失败
* 修改日期 版本号 修改人 修改内容
* -----------------------------------------------
* 2021/05/08 V1.0 张登雨 创建
***********************************************************************/
void FreePixelDatasForIcon(PT_PixelDatas ptPixelDatas)
{
Parser("bmp")->FreePixelDatas(ptPixelDatas);
}
/**********************************************************************
* 函数名称: isPictureFileSupported
* 功能描述: 判断本程序能否支持该图片文件,目前只能支持BMP/JPG格式的文件
* 输入参数: strFileName - 文件名,含绝对路径
* 输出参数: 无
* 返 回 值: 0 - 不支持, 1 - 支持
* 修改日期 版本号 修改人 修改内容
* -----------------------------------------------
* 2021/05/08 V1.0 张登雨 创建
***********************************************************************/
int isPictureFileSupported(char *strFileName)
{
T_FileMap tFileMap;
int iError;
strncpy(tFileMap.strFileName, strFileName, 256);
tFileMap.strFileName[255] = '\0';
iError = MapFile(&tFileMap);
if (iError) {
DBG_PRINTF("MapFile %s error!\n", strFileName);
return 0;
}
if (GetParser(&tFileMap) == NULL) {
UnMapFile(&tFileMap);
return 0;
}
UnMapFile(&tFileMap);
return 1;
}
/**********************************************************************
* 函数名称: GetPixelDatasFrmFile
* 功能描述: 从图片文件中取出象素数据
* 输入参数: strFileName - 文件名,含绝对路径
* 输出参数: ptPixelDatas - 内含象素数据
* 返 回 值: 0 - 成功, 其他值 - 失败
* 修改日期 版本号 修改人 修改内容
* -----------------------------------------------
* 2021/05/08 V1.0 张登雨 创建
***********************************************************************/
int GetPixelDatasFrmFile(char *strFileName, PT_PixelDatas ptPixelDatas)
{
T_FileMap tFileMap;
int iError;
int iXres, iYres, iBpp;
PT_PicFileParser ptParser;
strncpy(tFileMap.strFileName, strFileName, 256);
tFileMap.strFileName[255] = '\0';
iError = MapFile(&tFileMap);
if (iError) {
DBG_PRINTF("MapFile %s error!\n", strFileName);
return -1;
}
ptParser = GetParser(&tFileMap);
if (ptParser == NULL) {
UnMapFile(&tFileMap);
return -1;
}
GetDispResolution(&iXres, &iYres, &iBpp);
ptPixelDatas->iBpp = iBpp;
iError = ptParser->GetPixelDatas(&tFileMap, ptPixelDatas);
if (iError) {
DBG_PRINTF("GetPixelDatas for %s error!\n", strFileName);
UnMapFile(&tFileMap);
return -1;
}
UnMapFile(&tFileMap);
return 0;
}
/**********************************************************************
* 函数名称: FreePixelDatasFrmFile
* 功能描述: GetPixelDatasFrmFile从图片文件中取出象素数据时是动态分配内存的,
* FreePixelDatasFrmFile把分配的内存释放掉
* 输入参数: ptPixelDatas - 内含象素数据
* 输出参数: 无
* 返 回 值: 无
* 修改日期 版本号 修改人 修改内容
* -----------------------------------------------
* 2021/05/08 V1.0 张登雨 创建
***********************************************************************/
void FreePixelDatasFrmFile(PT_PixelDatas ptPixelDatas)
{
//Parser("bmp")->FreePixelDatas(ptPixelDatas);
free(ptPixelDatas->aucPixelDatas);
}
/**********************************************************************
* 函数名称: SetColorForPixelInVideoMem
* 功能描述: 设置VideoMem中某个座标象素的颜色
* 输入参数: iX,iY - 象素座标
* ptVideoMem - 设置VideoMem中的象素
* dwColor - 设置为这个颜色,颜色格式为0x00RRGGBB
* 输出参数: 无
* 返 回 值: 这个象素占据多少字节
* 修改日期 版本号 修改人 修改内容
* -----------------------------------------------
* 2021/05/08 V1.0 张登雨 创建
***********************************************************************/
static int SetColorForPixelInVideoMem(int iX, int iY, PT_VideoMem ptVideoMem, unsigned int dwColor)
{
unsigned char *pucVideoMem;
unsigned short *pwVideoMem16bpp;
unsigned int *pdwVideoMem32bpp;
unsigned short wColor16bpp; /* 565 */
int iRed;
int iGreen;
int iBlue;
pucVideoMem = ptVideoMem->tPixelDatas.aucPixelDatas;
pucVideoMem += iY * ptVideoMem->tPixelDatas.iLineBytes + iX * ptVideoMem->tPixelDatas.iBpp / 8;
pwVideoMem16bpp = (unsigned short *)pucVideoMem;
pdwVideoMem32bpp = (unsigned int *)pucVideoMem;
//DBG_PRINTF("%s %s %d\n", __FILE__, __FUNCTION__, __LINE__);
//DBG_PRINTF("x = %d, y = %d\n", iX, iY);
switch (ptVideoMem->tPixelDatas.iBpp)
{
case 8:
{
*pucVideoMem = (unsigned char)dwColor;
return 1;
break;
}
case 16:
{
iRed = (dwColor >> (16+3)) & 0x1f;
iGreen = (dwColor >> (8+2)) & 0x3f;
iBlue = (dwColor >> 3) & 0x1f;
wColor16bpp = (iRed << 11) | (iGreen << 5) | iBlue;
*pwVideoMem16bpp = wColor16bpp;
return 2;
break;
}
case 32:
{
*pdwVideoMem32bpp = dwColor;
return 4;
break;
}
default :
{
return -1;
}
}
return -1;
}
/**********************************************************************
* 函数名称: ClearRectangleInVideoMem
* 功能描述: 清除VideoMem中某个矩形区域,设为某颜色
* 输入参数: iTopLeftX,iTopLeftY - 矩形区域的左上角座标
* iBotRightX,iBotRightY - 矩形区域的右下角座标
* ptVideoMem - 设置VideoMem中的矩形区域
* dwColor - 设置为这个颜色,颜色格式为0x00RRGGBB
* 输出参数: 无
* 返 回 值: 无
* 修改日期 版本号 修改人 修改内容
* -----------------------------------------------
* 2021/05/08 V1.0 张登雨 创建
***********************************************************************/
void ClearRectangleInVideoMem(int iTopLeftX, int iTopLeftY, int iBotRightX, int iBotRightY, PT_VideoMem ptVideoMem, unsigned int dwColor)
{
int x, y;
for (y = iTopLeftY; y <= iBotRightY; y++)
for (x = iTopLeftX; x <= iBotRightX; x++)
SetColorForPixelInVideoMem(x, y, ptVideoMem, dwColor);
}
/**********************************************************************
* 函数名称: isFontInArea
* 功能描述: 要显示的字符是否完全在指定矩形区域内
* 输入参数: iTopLeftX,iTopLeftY - 矩形区域的左上角座标
* iBotRightX,iBotRightY - 矩形区域的右下角座标
* ptFontBitMap - 内含字符的位图信息
* 输出参数: 无
* 返 回 值: 0 - 超出了矩形区域, 1 - 完全在区域内
* 修改日期 版本号 修改人 修改内容
* -----------------------------------------------
* 2021/05/08 V1.0 张登雨 创建
***********************************************************************/
static int isFontInArea(int iTopLeftX, int iTopLeftY, int iBotRightX, int iBotRightY, PT_FontBitMap ptFontBitMap)
{
if ((ptFontBitMap->iXLeft >= iTopLeftX) && (ptFontBitMap->iXMax <= iBotRightX) && \
(ptFontBitMap->iYTop >= iTopLeftY) && (ptFontBitMap->iYMax <= iBotRightY)) {
return 1;
} else {
return 0;
}
}
/**********************************************************************
* 函数名称: MergeOneFontToVideoMem
* 功能描述: 根据位图中的数据把字符显示到videomem中
* 输入参数: ptVideoMem - VideoMem
* ptFontBitMap - 内含字符的位图信息
* 输出参数: 无
* 返 回 值: 0 - 成功, 其他值 - 失败
* 修改日期 版本号 修改人 修改内容
* -----------------------------------------------
* 2021/05/08 V1.0 张登雨 创建
***********************************************************************/
static int MergeOneFontToVideoMem(PT_FontBitMap ptFontBitMap, PT_VideoMem ptVideoMem)
{
int i;
int x, y;
int bit;
int iNum;
unsigned char ucByte;
if (ptFontBitMap->iBpp == 1)
{
for (y = ptFontBitMap->iYTop; y < ptFontBitMap->iYMax; y++)
{
i = (y - ptFontBitMap->iYTop) * ptFontBitMap->iPitch;
for (x = ptFontBitMap->iXLeft, bit = 7; x < ptFontBitMap->iXMax; x++)
{
if (bit == 7)
{
ucByte = ptFontBitMap->pucBuffer[i++];
}
if (ucByte & (1<<bit))
{
iNum = SetColorForPixelInVideoMem(x, y, ptVideoMem, COLOR_FOREGROUND);
}
else
{
/* 使用背景色 */
// g_ptDispOpr->ShowPixel(x, y, 0); /* 黑 */
iNum = SetColorForPixelInVideoMem(x, y, ptVideoMem, COLOR_BACKGROUND);
}
if (iNum == -1)
{
return -1;
}
bit--;
if (bit == -1)
{
bit = 7;
}
}
}
}
else if (ptFontBitMap->iBpp == 8)
{
for (y = ptFontBitMap->iYTop; y < ptFontBitMap->iYMax; y++)
for (x = ptFontBitMap->iXLeft; x < ptFontBitMap->iXMax; x++)
{
//g_ptDispOpr->ShowPixel(x, y, ptFontBitMap->pucBuffer[i++]);
if (ptFontBitMap->pucBuffer[i++])
{
iNum = SetColorForPixelInVideoMem(x, y, ptVideoMem, COLOR_FOREGROUND);
}
else
{
iNum = SetColorForPixelInVideoMem(x, y, ptVideoMem, COLOR_BACKGROUND);
}
if (iNum == -1)
{
return -1;
}
}
}
else
{
DBG_PRINTF("ShowOneFont error, can't support %d bpp\n", ptFontBitMap->iBpp);
return -1;
}
return 0;
}
/**********************************************************************
* 函数名称: MergerStringToCenterOfRectangleInVideoMem
* 功能描述: 在VideoMem的指定矩形居中显示字符串
* 参考: 03.freetype\02th_arm\06th_show_lines_center
* 输入参数: iTopLeftX,iTopLeftY - 矩形区域的左上角座标
* iBotRightX,iBotRightY - 矩形区域的右下角座标
* pucTextString - 要显示的字符串
* ptVideoMem - VideoMem
* 输出参数: 无
* 返 回 值: 0 - 成功, 其他值 - 失败
* 修改日期 版本号 修改人 修改内容
* -----------------------------------------------
* 2021/05/08 V1.0 张登雨 创建
***********************************************************************/
int MergerStringToCenterOfRectangleInVideoMem(int iTopLeftX, int iTopLeftY, int iBotRightX, int iBotRightY, unsigned char *pucTextString, PT_VideoMem ptVideoMem)
{
int iLen;
int iError;
unsigned char *pucBufStart;
unsigned char *pucBufEnd;
unsigned int dwCode;
T_FontBitMap tFontBitMap;
int bHasGetCode = 0;
int iMinX = 32000, iMaxX = -1;
int iMinY = 32000, iMaxY = -1;
int iStrTopLeftX , iStrTopLeftY;
int iWidth, iHeight;
tFontBitMap.iCurOriginX = 0;
tFontBitMap.iCurOriginY = 0;
pucBufStart = pucTextString;
pucBufEnd = pucTextString + strlen((char *)pucTextString);
/* 0. 清除这个区域 */
ClearRectangleInVideoMem(iTopLeftX, iTopLeftY, iBotRightX, iBotRightY, ptVideoMem, COLOR_BACKGROUND);
/* 1.先计算字符串显示的总体宽度、高度 */
while (1)
{
/* 从字符串中逐个取出字符 */
iLen = GetCodeFrmBuf(pucBufStart, pucBufEnd, &dwCode);
if (0 == iLen)
{
/* 字符串结束 */
if (!bHasGetCode)
{
//DBG_PRINTF("%s %s %d\n", __FILE__, __FUNCTION__, __LINE__);
return -1;
}
else
{
break;
}
}
bHasGetCode = 1;
pucBufStart += iLen;
/* 获得字符的位图, 位图信息里含有字符显示时的左上角、右下角坐标 */
iError = GetFontBitmap(dwCode, &tFontBitMap);
if (0 == iError)
{
if (iMinX > tFontBitMap.iXLeft)
{
iMinX = tFontBitMap.iXLeft;
}
if (iMaxX < tFontBitMap.iXMax)
{
iMaxX = tFontBitMap.iXMax;
}
if (iMinY > tFontBitMap.iYTop)
{
iMinY = tFontBitMap.iYTop;
}
if (iMaxY < tFontBitMap.iXMax)
{
iMaxY = tFontBitMap.iYMax;
}
tFontBitMap.iCurOriginX = tFontBitMap.iNextOriginX;
tFontBitMap.iCurOriginY = tFontBitMap.iNextOriginY;
}
else
{
DBG_PRINTF("GetFontBitmap for calc width/height error!\n");
}
}
iWidth = iMaxX - iMinX;
iHeight = iMaxY - iMinY;
/* 如果字符串过长 */
if (iWidth > iBotRightX - iTopLeftX)
{
iWidth = iBotRightX - iTopLeftX;
}
/* 如果字符串过高 */
if (iHeight > iBotRightY - iTopLeftY)
{
DBG_PRINTF("%s %s %d\n", __FILE__, __FUNCTION__, __LINE__);
//DBG_PRINTF("iHeight = %d, iBotRightY - iTopLeftX = %d - %d = %d\n", iHeight, iBotRightY, iTopLeftY, iBotRightY - iTopLeftY);
return -1;
}
//DBG_PRINTF("iWidth = %d, iHeight = %d\n", iWidth, iHeight);
/* 2.确定第1个字符的原点
* 2.1 先计算左上角坐标
*/
iStrTopLeftX = iTopLeftX + (iBotRightX - iTopLeftX - iWidth) / 2;
iStrTopLeftY = iTopLeftY + (iBotRightY - iTopLeftY - iHeight) / 2;
//DBG_PRINTF("iNewFirstFontTopLeftX = %d, iNewFirstFontTopLeftY = %d\n", iNewFirstFontTopLeftX, iNewFirstFontTopLeftY);
/*
* 2.2 再计算第1个字符原点坐标
* iMinX - 原来的iCurOriginX(0) = iStrTopLeftX - 新的iCurOriginX
* iMinY - 原来的iCurOriginY(0) = iStrTopLeftY - 新的iCurOriginY
*/
tFontBitMap.iCurOriginX = iStrTopLeftX - iMinX;
tFontBitMap.iCurOriginY = iStrTopLeftY - iMinY;
//DBG_PRINTF("iCurOriginX = %d, iCurOriginY = %d\n", tFontBitMap.iCurOriginX, tFontBitMap.iCurOriginY);
pucBufStart = pucTextString;
bHasGetCode = 0;
while (1)
{
/* 从字符串中逐个取出字符 */
iLen = GetCodeFrmBuf(pucBufStart, pucBufEnd, &dwCode);
if (0 == iLen)
{
/* 字符串结束 */
if (!bHasGetCode)
{
DBG_PRINTF("%s %s %d\n", __FILE__, __FUNCTION__, __LINE__);
return -1;
}
else
{
break;
}
}
bHasGetCode = 1;
pucBufStart += iLen;
/* 获得字符的位图 */
iError = GetFontBitmap(dwCode, &tFontBitMap);
if (0 == iError)
{
//DBG_PRINTF("%s %s %d\n", __FILE__, __FUNCTION__, __LINE__);
/* 显示一个字符 */
if (isFontInArea(iTopLeftX, iTopLeftY, iBotRightX, iBotRightY, &tFontBitMap))
{
if (MergeOneFontToVideoMem(&tFontBitMap, ptVideoMem))
{
DBG_PRINTF("MergeOneFontToVideoMem error for code 0x%x\n", dwCode);
return -1;
}
}
else
{
return 0;
}
//DBG_PRINTF("%s %s %d\n", __FILE__, __FUNCTION__, __LINE__);
tFontBitMap.iCurOriginX = tFontBitMap.iNextOriginX;
tFontBitMap.iCurOriginY = tFontBitMap.iNextOriginY;
}
else
{
DBG_PRINTF("GetFontBitmap for drawing error!\n");
}
}
return 0;
}
/**********************************************************************
* 函数名称: InvertButton
* 功能描述: 是把显示设备上指定区域里每个象素的颜色取反
* 输入参数: ptLayout - 矩形区域
* 输出参数: 无
* 返 回 值: 无
* 修改日期 版本号 修改人 修改内容
* -----------------------------------------------
* 2021/05/08 V1.0 张登雨 创建
***********************************************************************/
static void InvertButton(PT_Layout ptLayout)
{
int iY;
int i;
int iButtonWidthBytes;
unsigned char *pucVideoMem;
PT_DispOpr ptDispOpr = GetDefaultDispDev();
pucVideoMem = ptDispOpr->pucDispMem;
pucVideoMem += ptLayout->iTopLeftY * ptDispOpr->iLineWidth + ptLayout->iTopLeftX * ptDispOpr->iBpp / 8; /* 图标在Framebuffer中的地址 */
iButtonWidthBytes = (ptLayout->iBotRightX - ptLayout->iTopLeftX + 1) * ptDispOpr->iBpp / 8;
for (iY = ptLayout->iTopLeftY; iY <= ptLayout->iBotRightY; iY++) {
for (i = 0; i < iButtonWidthBytes; i++) {
pucVideoMem[i] = ~pucVideoMem[i]; /* 取反 */
}
pucVideoMem += ptDispOpr->iLineWidth;
}
}
/**********************************************************************
* 函数名称: ReleaseButton
* 功能描述: 松开图标,只是改变显示设备上的图标按钮颜色
* 输入参数: ptLayout - 图标所在矩形区域
* 输出参数: 无
* 返 回 值: 无
* 修改日期 版本号 修改人 修改内容
* -----------------------------------------------
* 2021/05/08 V1.0 张登雨 创建
***********************************************************************/
void ReleaseButton(PT_Layout ptLayout)
{
InvertButton(ptLayout);
}
/**********************************************************************
* 函数名称: PressButton
* 功能描述: 按下图标,只是改变显示设备上的图标按钮颜色
* 输入参数: ptLayout - 图标所在矩形区域
* 输出参数: 无
* 返 回 值: 无
* 修改日期 版本号 修改人 修改内容
* -----------------------------------------------
* 2021/05/08 V1.0 张登雨 创建
***********************************************************************/
void PressButton(PT_Layout ptLayout)
{
InvertButton(ptLayout);
}