TA的每日心情 | 郁闷 2024-10-28 10:11 |
---|
签到天数: 1703 天 连续签到: 1 天 [LV.Master]伴坛终老
|
仔细看了下asf里面的gfx_mono_generic_put_bitmap:- /**
- * \brief Put bitmap from FLASH or RAM to display
- *
- * This function will output bitmap data from FLASH or RAM.
- * The bitmap y-coordinate will be aligned with display pages, rounded down.
- * Ie: placing a bitmap at x=10, y=5 will put the bitmap at x = 10,y = 0 and
- * placing a bitmap at x = 10, y = 10 will put the bitmap at x = 10, y = 8
- *
- */
- void gfx_mono_generic_put_bitmap(struct gfx_mono_bitmap *bitmap, gfx_coord_t x,
- gfx_coord_t y)
- {
- gfx_coord_t num_pages = bitmap->height / 8;
- gfx_coord_t page = y / 8;
- gfx_coord_t column;
- gfx_coord_t i;
- gfx_mono_color_t temp;
- switch (bitmap->type) {
- case GFX_MONO_BITMAP_PROGMEM:
- for (i = 0; i < num_pages; i++) {
- for (column = 0; column < bitmap->width; column++) {
- temp = PROGMEM_READ_BYTE(bitmap->data.progmem
- + (i * bitmap->width)
- + column);
- gfx_mono_put_byte(i + page, column + x, temp);
- }
- }
- break;
- case GFX_MONO_BITMAP_RAM:
- for (i = 0; i < num_pages; i++) {
- gfx_mono_put_page(bitmap->data.pixmap
- + (i * bitmap->width), page + i, x,
- bitmap->width);
- }
- break;
- default:
- break;
- }
- }
复制代码 得出3个结论:
1】y实际上会当作 (y>>3)<<3来用
2】是按整页(page)画的图
3】struct gfx_mono_bitmap 中.height 应该是8的倍数
顺便说一下,和其他的页更新lcd控制器类似,图存储时是旋转了90度的。比如那个8x5的月亮,bitmap数组里是这样的:
|
|