没有合适的资源?快使用搜索试试~ 我知道了~
首页emWin V5.20图形库用户与参考指南
emWin是由SEGGER Microcontroller GmbH & Co. KG开发的一款图形库,专为嵌入式系统提供图形用户界面(GUI)的功能。这份文档是UM03001用户与参考指南,针对软件版本V5.20进行编写,文档修订至第2版,发布日期为2013年3月8日。该指南详细介绍了如何利用emWin创建和管理图形界面,包括窗口、控件、布局和事件处理等方面。
emWin作为一个图形库,它允许开发人员在嵌入式设备上构建直观、高效的用户界面,这对于许多工业控制、消费电子和物联网应用至关重要。用户手册涵盖了以下几个关键知识点:
1. **入门与安装**:指南首先介绍了如何安装和配置emWin在开发环境中,确保兼容性和性能优化。
2. **图形组件**:涵盖了各种图形元素,如窗口(Window)、按钮(Button)、文本框(Text Field)、滑块(Slider)和图像显示(Bitmap),以及如何创建和定制这些基本UI元素。
3. **布局管理**:讨论了如何组织和定位控件,实现响应式布局,适应不同屏幕尺寸和分辨率。
4. **事件处理**:详细解释了如何通过回调函数或消息机制来处理用户的交互,如点击、触摸、键盘输入等。
5. **主题与皮肤**:emWin支持自定义主题,以适应不同的品牌和设计风格,提升用户体验。
6. **性能与内存管理**:提供了优化代码以减少内存消耗和提高运行速度的最佳实践,这对于资源受限的嵌入式系统尤其重要。
7. **API与编程接口**:文档详述了C/C++ API,让开发者能够深入了解其工作原理,并提供示例代码来加速学习过程。
8. **跨平台支持**:尽管针对的是嵌入式环境,但emWin也考虑到了兼容性问题,确保在多种微控制器平台上的一致性。
9. **免责声明与版权**:文档强调了信息的准确性和可能的更新,但不保证完全无误,并声明了版权和使用限制,禁止未经许可的复制或修改PDF文件。
emWin V5.20用户与参考指南是一份全面且实用的文档,旨在帮助开发者充分利用其图形库功能,打造高效、用户友好的嵌入式应用程序。通过遵循文档中的指导,开发者可以有效地将复杂的界面操作简化为嵌入式系统的实际应用。
16
UM03001 User & Reference Guide for emWin V5.20 © 1997 - 2013 SEGGER Microcontroller GmbH & Co. KG
10.9 ’SIF’ file related font functions..................................................................205
10.10 ’TTF’ file related font functions .................................................................207
10.11 ’XBF’ file related font functions.................................................................210
10.12 Common font-related functions ................................................................212
10.13 Character sets .......................................................................................216
10.13.1 ASCII ...................................................................................................216
10.13.2 ISO 8859-1 Western Latin character set....................................................216
10.13.3 Unicode ................................................................................................218
10.14 Font Converter.......................................................................................219
10.14.1 Adding fonts..........................................................................................219
10.15 Standard fonts.......................................................................................220
10.15.1 Font identifier naming convention.............................................................220
10.15.2 Font file naming convention.....................................................................221
10.15.3 Measurement, ROM-size and character set of fonts .....................................221
10.15.4 Proportional fonts...................................................................................222
10.15.4.1 Overview ..............................................................................................222
10.15.4.2 Measurement, ROM size and used files......................................................222
10.15.4.3 Characters ............................................................................................224
10.15.5 Proportional fonts, framed.......................................................................230
10.15.5.1 Overview ..............................................................................................230
10.15.5.2 Measurement, ROM size and used files......................................................230
10.15.5.3 Characters ............................................................................................230
10.15.6 Monospaced fonts ..................................................................................231
10.15.6.1 Overview ..............................................................................................231
10.15.6.2 Measurement, ROM size and used files......................................................232
10.15.6.3 Characters ............................................................................................233
10.15.7 Digit fonts (proportional).........................................................................238
10.15.7.1 Overview ..............................................................................................238
10.15.7.2 Measurement, ROM size and used files......................................................238
10.15.7.3 Characters ............................................................................................238
10.15.8 Digit fonts (monospaced) ........................................................................240
10.15.8.1 Overview ..............................................................................................240
10.15.8.2 Measurement, ROM size and used files......................................................240
10.15.8.3 Characters ............................................................................................240
11 Font Converter...........................................................................................................243
11.1 Requirements ........................................................................................244
11.2 Using the Font Converter.........................................................................245
11.2.1 Creating an emWin font file from a Windows font .......................................245
11.2.2 Font generation options dialog .................................................................247
11.2.2.1 Type of font to generate..........................................................................247
11.2.2.2 Encoding...............................................................................................248
11.2.2.3 Antialiasing ...........................................................................................248
11.2.3 Font Dialog............................................................................................248
11.2.3.1 Font, Font Style, and Size .......................................................................249
11.2.3.2 Script ...................................................................................................249
11.2.3.3 Unit of Size ...........................................................................................249
11.2.4 User Interface........................................................................................249
11.2.4.1 Selecting the current character ................................................................249
11.2.4.2 Toggling character status ........................................................................249
11.2.4.3 Selecting pixels......................................................................................250
11.2.4.4 Modifying character bits ..........................................................................250
11.2.4.5 Operations ............................................................................................250
11.2.4.6 Modifying the viewing mode ....................................................................251
11.3 Options.................................................................................................251
11.3.1 Saving the font ......................................................................................252
11.3.1.1 Creating a C file .....................................................................................252
11.3.1.2 Creating a System Independent Font (SIF) ................................................253
11.3.1.3 Creating an External Binary Font (XBF) .....................................................253
11.3.2 Modifying an existing C font file................................................................254
11.3.3 Merging fonts with existing C font files ......................................................255
UM03001 User & Reference Guide for emWin V5.20 © 1997 - 2013 SEGGER Microcontroller GmbH & Co. KG
17
11.4 Pattern files .......................................................................................... 256
11.4.1 Creating pattern files using Notepad......................................................... 256
11.4.2 Creating pattern files using the Font Converter .......................................... 256
11.4.3 Enabling characters using a pattern file .................................................... 256
11.5 Supported output modes ........................................................................ 256
11.5.1 Standard mode ..................................................................................... 257
11.5.2 Antialiased modes.................................................................................. 257
11.6 Command line options............................................................................ 258
11.6.1 Table of commands................................................................................ 258
11.6.2 Execution examples ............................................................................... 259
11.7 Font Examples ...................................................................................... 260
11.7.1 Resulting C code, standard mode............................................................. 260
11.8 Resulting C code, 2 bpp antialiased mode ................................................. 261
11.9 Resulting C code, 4 bpp antialiased mode ................................................. 262
11.10 Resulting C code, extended mode ............................................................ 263
12 Colors.........................................................................................................................265
12.1 Predefined colors................................................................................... 266
12.2 The color bar test routine ....................................................................... 266
12.3 Fixed palette modes............................................................................... 267
12.4 Detailed fixed palette mode description .................................................... 268
12.5 Application defined color conversion......................................................... 279
12.6 Custom palette mode ............................................................................. 280
12.7 Gamma correction ................................................................................. 280
12.8 Color API.............................................................................................. 281
12.8.1 Basic color functions .............................................................................. 282
12.8.2 Index & color conversion ........................................................................ 284
13 Memory Devices ........................................................................................................287
13.1 Using Memory Devices: an illustration ...................................................... 288
13.2 Supported color depth (bpp) ................................................................... 288
13.3 Memory Devices and the Window Manager................................................ 289
13.4 Memory Devices and multiple layers......................................................... 289
13.5 Memory requirements ............................................................................ 289
13.6 Performance ......................................................................................... 290
13.7 Basic functions ...................................................................................... 291
13.8 In order to be able to use Memory Devices................................................ 291
13.9 Multi layer / multi display configurations................................................... 291
13.10 Configuration options ............................................................................. 291
13.10.1 GUI_USE_MEMDEV_1BPP_FOR_SCREEN ................................................... 291
13.11 Memory device API ................................................................................ 292
13.12 Basic functions...................................................................................... 293
13.13 Banding Memory Device ......................................................................... 307
13.14 Auto device object ................................................................................. 308
13.15 Measurement device object..................................................................... 311
13.16 Animation functions ............................................................................... 313
13.17 Animation functions (Window Manager required)........................................ 314
14 Execution Model: Single Task / Multitask ..................................................................319
14.1 Supported execution models ................................................................... 320
14.2 Single task system (superloop)................................................................ 320
14.2.1 Description ........................................................................................... 320
14.2.2 Superloop example (without emWin)........................................................ 320
14.2.3 Advantages........................................................................................... 320
14.2.4 Disadvantages ...................................................................................... 320
14.2.5 Using emWin......................................................................................... 320
14.2.6 Superloop example (with emWin) ............................................................ 321
14.3 Multitask system: one task calling emWin ................................................. 321
14.3.1 Description ........................................................................................... 321
14.3.2 Advantages........................................................................................... 321
18
UM03001 User & Reference Guide for emWin V5.20 © 1997 - 2013 SEGGER Microcontroller GmbH & Co. KG
14.3.3 Disadvantages .......................................................................................321
14.3.4 Using emWin .........................................................................................321
14.4 Multitask system: multiple tasks calling emWin ..........................................322
14.4.1 Description............................................................................................322
14.4.2 Advantages ...........................................................................................322
14.4.3 Disadvantages .......................................................................................322
14.4.4 Using emWin .........................................................................................322
14.4.5 Recommendations..................................................................................322
14.4.6 Example ...............................................................................................322
14.5 Configuration functions for multitasking support.........................................323
14.6 Configuration macros for multitasking support ...........................................325
14.7 Kernel interface API................................................................................326
14.7.1 Examples ..............................................................................................329
15 The Window Manager (WM)......................................................................................331
15.1 Description of terms ...............................................................................332
15.2 Callback mechanism, invalidation, rendering and keyboard input ..................333
15.2.1 Rendering without callbacks.....................................................................333
15.2.2 Rendering using callbacks .......................................................................334
15.2.3 Overwriting callback functions..................................................................334
15.2.4 Background window redrawing and callback...............................................335
15.2.5 Invalidation...........................................................................................336
15.2.6 Rendering of transparent windows............................................................336
15.2.7 Automatic use of memory devices ............................................................336
15.2.8 Automatic use of multiple frame buffers ....................................................336
15.2.9 Automatic use of display driver cache .......................................................337
15.2.10 Keyboard input ......................................................................................337
15.3 Motion support.......................................................................................337
15.3.1 Enabling motion support of the WM ..........................................................337
15.3.2 Basic motion support for a window ...........................................................337
15.3.2.1 Using creation flags ................................................................................337
15.3.2.2 Using API function..................................................................................337
15.3.3 Advanced motion support........................................................................338
15.3.3.1 WM_MOTION message and WM_MOTION_INFO..........................................338
15.4 ToolTips................................................................................................339
15.4.1 How they work.......................................................................................339
15.4.2 Creating ToolTips ...................................................................................339
15.4.2.1 Creating ToolTips for dialog items.............................................................339
15.4.2.2 Creating ToolTips for simple windows........................................................340
15.5 Messages ..............................................................................................340
15.5.1 Message structure ..................................................................................340
15.5.2 List of messages ....................................................................................341
15.5.3 System-defined messages.......................................................................342
15.5.4 Pointer input device (PID) messages.........................................................346
15.5.5 System-defined notification codes ............................................................350
15.5.6 Application-defined messages ..................................................................350
15.6 Configuration options..............................................................................351
15.7 WM API.................................................................................................352
15.7.1 Using the WM API functions.....................................................................354
15.8 WM API: Basic functions..........................................................................355
15.9 WM API: Motion support..........................................................................385
15.10 WM API: ToolTip related functions ............................................................389
15.11 WM API: Memory device support (optional) ...............................................392
15.12 WM API: Timer related functions ..............................................................393
15.13 WM API: Widget related functions.............................................................395
15.14 Example ...............................................................................................399
16 Window Objects (Widgets).........................................................................................401
16.1 Some basics ..........................................................................................402
16.1.1 Available widgets ...................................................................................402
UM03001 User & Reference Guide for emWin V5.20 © 1997 - 2013 SEGGER Microcontroller GmbH & Co. KG
19
16.1.2 Understanding the redrawing mechanism.................................................. 403
16.1.3 How to use widgets................................................................................ 403
16.2 Configuration options ............................................................................. 405
16.3 Widget IDs ........................................................................................... 406
16.4 General widget API ................................................................................ 406
16.4.1 WM routines used for widgets.................................................................. 406
16.4.2 Common routines .................................................................................. 406
16.4.3 User drawn widgets ............................................................................... 410
16.5 BUTTON: Button widget.......................................................................... 412
16.5.1 Configuration options ............................................................................. 412
16.5.2 Predefined IDs ...................................................................................... 413
16.5.3 Notification codes .................................................................................. 413
16.5.4 Keyboard reaction ................................................................................. 413
16.5.5 BUTTON API ......................................................................................... 413
16.5.6 Examples ............................................................................................. 426
16.6 CHECKBOX: Checkbox widget ................................................................. 428
16.6.1 Configuration options ............................................................................. 428
16.6.2 Predefined IDs ...................................................................................... 429
16.6.3 Notification codes .................................................................................. 429
16.6.4 Keyboard reaction ................................................................................. 429
16.6.5 CHECKBOX API...................................................................................... 429
16.6.6 Example............................................................................................... 443
16.7 DROPDOWN: Dropdown widget ............................................................... 444
16.7.1 Configuration options ............................................................................. 444
16.7.2 Predefined IDs ...................................................................................... 445
16.7.3 Notification codes .................................................................................. 445
16.7.4 Keyboard reaction ................................................................................. 445
16.7.5 DROPDOWN API .................................................................................... 445
16.7.6 Example............................................................................................... 458
16.8 EDIT: Edit widget .................................................................................. 459
16.8.1 Configuration options ............................................................................. 459
16.8.2 Predefined IDs ...................................................................................... 459
16.8.3 Notification codes .................................................................................. 459
16.8.4 Keyboard reaction ................................................................................. 460
16.8.5 EDIT API .............................................................................................. 460
16.8.6 Examples ............................................................................................. 477
16.9 FRAMEWIN: Frame window widget........................................................... 478
16.9.1 Structure of the frame window ................................................................ 479
16.9.2 Configuration options ............................................................................. 480
16.9.3 Keyboard reaction ................................................................................. 480
16.9.4 FRAMEWIN API...................................................................................... 480
16.9.5 Example............................................................................................... 501
16.10 GRAPH: Graph widget ............................................................................ 502
16.10.1 Structure of the graph widget.................................................................. 502
16.10.2 Creating and deleting a graph widget ....................................................... 503
16.10.3 Drawing process.................................................................................... 503
16.10.4 Supported types of curves ...................................................................... 503
16.10.4.1 GRAPH_DATA_XY .................................................................................. 504
16.10.4.2 GRAPH_DATA_YT................................................................................... 504
16.10.5 Configuration options ............................................................................. 504
16.10.5.1 Graph widget ........................................................................................ 504
16.10.5.2 Scale object.......................................................................................... 504
16.10.6 Predefined IDs ...................................................................................... 504
16.10.7 Keyboard reaction ................................................................................. 504
16.10.8 GRAPH API ........................................................................................... 504
16.10.8.1 Common routines .................................................................................. 506
16.10.8.2 GRAPH_DATA_YT related routines............................................................ 514
16.10.8.3 GRAPH_DATA_XY related routines............................................................ 518
16.10.8.4 Scale related routines ............................................................................ 522
16.10.9 Examples ............................................................................................. 527
16.11 HEADER: Header widget ......................................................................... 528
20
UM03001 User & Reference Guide for emWin V5.20 © 1997 - 2013 SEGGER Microcontroller GmbH & Co. KG
16.11.1 Configuration options..............................................................................529
16.11.2 Notification codes...................................................................................529
16.11.3 Keyboard reaction ..................................................................................529
16.11.4 HEADER API ..........................................................................................529
16.11.5 Example ...............................................................................................541
16.12 ICONVIEW: Icon view widget ...................................................................542
16.12.1 Configuration options..............................................................................542
16.12.2 Predefined IDs .......................................................................................543
16.12.3 Notification codes...................................................................................543
16.12.4 Keyboard reaction ..................................................................................543
16.12.5 ICONVIEW API.......................................................................................543
16.12.6 Example ...............................................................................................555
16.13 IMAGE: Image widget.............................................................................556
16.13.1 Configuration options..............................................................................556
16.13.2 Predefined IDs .......................................................................................556
16.13.3 IMAGE API ............................................................................................556
16.14 LISTBOX: List box widget........................................................................559
16.14.1 Configuration options..............................................................................559
16.14.2 Predefined IDs .......................................................................................559
16.14.3 Notification codes...................................................................................559
16.14.4 Keyboard reaction ..................................................................................560
16.14.5 LISTBOX API .........................................................................................560
16.14.6 Examples ..............................................................................................576
16.15 LISTVIEW: Listview widget ......................................................................577
16.15.1 Configuration options..............................................................................578
16.15.2 Predefined IDs .......................................................................................578
16.15.3 Notification codes...................................................................................578
16.15.4 Keyboard reaction ..................................................................................579
16.15.5 LISTVIEW API........................................................................................579
16.15.6 Example ...............................................................................................601
16.16 LISTWHEEL: Listwheel widget ..................................................................602
16.16.1 Configuration options..............................................................................602
16.16.2 Predefined IDs .......................................................................................602
16.16.3 Notification codes...................................................................................602
16.16.4 Keyboard reaction ..................................................................................603
16.16.5 LISTWHEEL API......................................................................................603
16.17 MENU: Menu widget ...............................................................................616
16.17.1 Menu messages .....................................................................................617
16.17.2 Data structures......................................................................................618
16.17.3 Configuration options..............................................................................618
16.17.4 Keyboard reaction ..................................................................................619
16.17.5 MENU API .............................................................................................619
16.17.6 Example ...............................................................................................633
16.18 MULTIEDIT: Multi line text widget.............................................................634
16.18.1 Configuration options..............................................................................634
16.18.2 Predefined IDs .......................................................................................635
16.18.3 Notification codes...................................................................................635
16.18.4 Keyboard reaction ..................................................................................635
16.18.5 MULTIEDIT API ......................................................................................635
16.18.6 Example ...............................................................................................645
16.19 MULTIPAGE: Multiple page widget ............................................................646
16.19.1 Configuration options..............................................................................647
16.19.2 Predefined IDs .......................................................................................647
16.19.3 Notification codes...................................................................................647
16.19.4 Keyboard reaction ..................................................................................647
16.19.5 MULTIPAGE API .....................................................................................647
16.19.6 Example ...............................................................................................659
16.20 PROGBAR: Progress bar widget ................................................................660
16.20.1 Configuration options..............................................................................660
16.20.2 Predefined IDs .......................................................................................660
16.20.3 Keyboard reaction ..................................................................................660
剩余1075页未读,继续阅读
2021-10-03 上传
2020-04-09 上传
点击了解资源详情
2021-10-03 上传
2022-06-06 上传
189 浏览量
182 浏览量
2016-12-03 上传
rtoax
- 粉丝: 2761
- 资源: 218
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- Raspberry Pi OpenCL驱动程序安装与QEMU仿真指南
- Apache RocketMQ Go客户端:全面支持与消息处理功能
- WStage平台:无线传感器网络阶段数据交互技术
- 基于Java SpringBoot和微信小程序的ssm智能仓储系统开发
- CorrectMe项目:自动更正与建议API的开发与应用
- IdeaBiz请求处理程序JAVA:自动化API调用与令牌管理
- 墨西哥面包店研讨会:介绍关键业绩指标(KPI)与评估标准
- 2014年Android音乐播放器源码学习分享
- CleverRecyclerView扩展库:滑动效果与特性增强
- 利用Python和SURF特征识别斑点猫图像
- Wurpr开源PHP MySQL包装器:安全易用且高效
- Scratch少儿编程:Kanon妹系闹钟音效素材包
- 食品分享社交应用的开发教程与功能介绍
- Cookies by lfj.io: 浏览数据智能管理与同步工具
- 掌握SSH框架与SpringMVC Hibernate集成教程
- C语言实现FFT算法及互相关性能优化指南
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功