如何在没有png图像的情况下清理cairo的表面区域

时间:2016-01-28 03:29:38

标签: gtk cairo

这将清除所有

 void surface_clean(Mpaint *mpaint)

    {
         mpaint->surface=cairo_image_surface_create_from_png ("cxl.cache.png");
    }

我想用x,y,width,height来清理cairo_surface_t中的区域。

有没有接口?

1 个答案:

答案 0 :(得分:1)

在此处[1]检查CAIRO_OPERATOR_ *。 pycairo代码:

ctx.set_source_rgba(0.0, 0.0, 0.0, 0.0)
ctx.set_operator(cairo.OPERATOR_CLEAR)
ctx.rectangle(x, y, width, height)
ctx.paint_with_alpha(1.0)

[1] https://cairographics.org/operators/

相关问题