|

楼主 |
发表于 2021-5-31 15:53:57
|
显示全部楼层
研究了一下代码,发现这种方式可以实现,但很麻烦,
有些函数要自己实现,
display -> gx_display_driver_pixel_write = _gx_display_driver_16bpp_pixel_write;
这个是写点函数,这个实现起来倒是不难,但有一堆基础函数是基于内存的
没有画布是完不成了,
VOID _gx_display_driver_16bpp_simple_line_draw(GX_DRAW_CONTEXT *context, INT xstart, INT ystart, INT xend, INT yend)
//这个是直接操作内存,如果没有画布内存,要自己实现,要哭死,
put = (USHORT *)(context -> gx_draw_context_memory) + ystart * context -> gx_draw_context_pitch + xstart;
next_put = (USHORT *)(context -> gx_draw_context_memory) + yend * context -> gx_draw_context_pitch + xend;
/**************************************************************************/
VOID _gx_display_driver_565rgb_pixel_blend(GX_DRAW_CONTEXT *context, INT x, INT y, GX_COLOR fcolor, GX_UBYTE alpha)
{
GX_UBYTE fred, fgreen, fblue;
GX_UBYTE bred, bgreen, bblue;
GX_UBYTE balpha;
USHORT bcolor;
USHORT *put;
/* Is the pixel non-transparent? */
if (alpha > 0)
{
/* calculate address of pixel */
put = (USHORT *)context -> gx_draw_context_memory;
put += context -> gx_draw_context_pitch * y;
这些都是基于画布内存的,没有画布内存,实现这一堆画线,画圆函数
|
|