Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Sokyx opened this issue Oct 26, 2022 · 0 comments

Comments

@Sokyx
Copy link

Sokyx commented Oct 26, 2022

代码如下:
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;

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant