Skip to main content
  • 产品
  • Evaluate our Software
  • 下载
  • Free Utilities
  • 购买
  • 支持
  • 关于我们
  • Search
    • Contact Us
    • Forum
    • Knowledge Base
    • Newsletter
    • RSS
  •   工作机会
  •   视频
  •   永续性
  • emWin
  • Antialiasing
  • Technology
  • Demos
  • Add-ons
  • Tools
  • emWin Source Upgrade

Antialiasing

Support for antialiasing is a separate software item and is not included in the emWin basic package.

Contact us
Downloads
Documentation
SEGGER emWin
  1. 1.How it works
  2. 2.Antialiasing Quality
  3. 3.Antialiased Fonts
  4. 4.High-Resolution Coordinates

How it works

Lines are approximated by a series of pixels that must lie at display coordinates. They can therefore appear jagged, especially nearly horizontal or nearly vertical lines. This jaggedness is called aliasing. Antialiasing is the smoothing of lines and curves. It reduces the jagged, stair-step appearance of any line that is not exactly horizontal or vertical. emWin supports different antialiasing qualities, antialiased fonts and high-resolution coordinates.

Antialiasing smoothes curves and diagonal lines by "blending" the background color with that of the foreground. The higher the number of shades used between background and foreground colors, the better the antialiasing result (and the longer the computation time).

Antialiasing Quality

The quality of antialiasing can be set with a factor between 1 and 6, where 1 means no antialiasing and 6 the highest quality. For most applications factor 4 is sufficient and is a good compromise between quality and performance.

example screenshot above

Antialiased Fonts

Fonts are available with two levels of antialiasing, low-quality (2bpp) and high-quality (4bpp). The following table shows the effect on drawing the character C without antialiasing and with both types of antialiased fonts.

Antialiased fonts can be created using the Font Converter. The general purpose of using antialiased fonts is to improve the appearance of text. While the effect of using high-quality antialiasing will be visually more pleasing than low-quality antialiasing, computation time and memory consumption will increase proportionally. Low-quality (2bpp) fonts require twice the memory of non-antialiased (1bpp) fonts; high-quality (4bpp) fonts require four times the memory.

 

Font type Black on white White on black

Standard (no antialiasing)
1 bpp, 2 shades

Standard black on white characterStandard white on black character
Low-quality (antialiased)
2 bpp, 4 shades
Antialiased black on white characterAntialiased white on black character
High-quality (antialiased)
4 bpp, 16 shades
Antialiased black on white character (high quality)Antialiased white on black character (high quality)

High-Resolution Coordinates

When drawing items using antialiasing, the same coordinates are used as for regular (non-antialiasing) drawing routines. This is the default mode. It is not required to consider the antialiasing factor in the function arguments. An antialiased line from (50, 100) to (100, 50) would be drawn with the following function call:

GUI_AA_DrawLine(50, 100, 100, 50);

The high-resolution feature of emWin lets you use the virtual space determined by the antialiasing factor and your display size. The advantage of using high-resolution coordinates is that items can be placed not only at physical positions of your display but also "between" them.

The virtual space of a high-resolution pixel is illustrated beneath based on an antialiasing factor of 3:

To draw a line from pixel (50, 100) to (100, 50) in high-resolution mode with antialiasing factor 3, one would write:

GUI_AA_DrawLine(150, 300, 300, 150);

High-resolution coordinates must be enabled with the routine GUI_AA_EnableHiRes(), and may be disabled with GUI_AA_DisableHiRes(). Both functions are explained later in the chapter. For example programs using the high-resolution feature, see the examples at the end of the chapter.

high resolution coordinates antialiasing facor

全球总部

德国: SEGGER Microcontroller GmbH

地址: Ecolab-Allee 5
40789 Monheim am Rhein, Germany
电邮: info@segger.com
电话: +49-2173-99312-0
传真: +49-2173-99312-28

网点分布

中国:哲戈微系统科技(上海)有限公司

地址: 中国上海市闵行区秀涟路133号
大虹桥国际A 栋218室
邮编201199
电邮: china@segger.com
电话: +86-133-619-907-60

通过ISO 9001认证

ISO 9001

30多年的嵌入式行业经验

First-class embedded software tools since 1992
  • 版本说明
  • 免责声明
  • 隐私策略
  • 沪ICP备2022005181号
  • 沪公网安备 31011202014525号
© 2025 SEGGER - 版权所有.

您即将离开 segger.cn 而访问境外网站,是否继续?