awtk-linux-fb icon indicating copy to clipboard operation
awtk-linux-fb copied to clipboard

drm显示下,默认用的BGRA8888颜色格式,代码中无法用alpha绘制透明

Open Sokyx opened this issue 2 years ago • 0 comments

代码如下: static ret_t _home_unlock_on_paint_event(void* ctx, event_t* evt) { widget_t* canvas_widget = WIDGET(ctx); canvas_t* canvas = paint_event_cast(evt)->c; point_t p = {0};

p.x = canvas_widget->x;
p.y = canvas_widget->y;
widget_to_local(canvas_widget,&p);	//transform to widget local xy
int w = canvas_widget->w;
int h = canvas_widget->h;

canvas_set_fill_color(canvas, color_init(0x00, 0xFF, 0x00, 0x00));
canvas_clear_rect(canvas, p.x, p.y, w, h);

return RET_OK;

} 没有效果。界面会显示绿色

Sokyx avatar Oct 26 '22 11:10 Sokyx