image value support hex number

This commit is contained in:
lixianjing 2020-06-10 17:31:46 +08:00
parent 9ebab14d4a
commit 916e9e6491
2 changed files with 2 additions and 1 deletions

View File

@ -3,6 +3,7 @@
* 2020/06/10
* 增加宏 NATIVE_WINDOW_BORDERLESS 控制是否去掉 native window 的标题栏。
* 增加 FAQ《应用程序在 Windows 的手持设备中运行,如何去掉窗口的标题栏》
* image value 支持16进制格式。
* 2020/06/09
* 增加 dll 导出函数(感谢俊杰提供补丁)。

View File

@ -73,7 +73,7 @@ static ret_t image_value_on_paint_self(widget_t* widget, canvas_t* c) {
memset(bitmap, 0x00, sizeof(bitmap));
memset(sub_name, 0x00, sizeof(sub_name));
if (strchr(format, 'd') != NULL) {
if (strchr(format, 'd') != NULL || strchr(format, 'x') != NULL || strchr(format, 'X') != NULL) {
tk_snprintf(str, IMAGE_VALUE_MAX_CHAR_NR, format, tk_roundi(image_value->value));
} else {
tk_snprintf(str, IMAGE_VALUE_MAX_CHAR_NR, format, image_value->value);