python类OPERATOR_SOURCE的实例源码

grid.py 文件源码 项目:ns3-rdma 作者: bobzhuyb 项目源码 文件源码 阅读 27 收藏 0 点赞 0 评论 0
def draw_line(self, ctx, x, y, width, height):
        ctx.move_to(x, y)
        ctx.rel_line_to(width, height)
        ctx.close_path()
        ctx.set_operator(cairo.OPERATOR_SOURCE)
        ctx.set_line_width(1.0)
        ctx.set_source_rgb(0, 0, 0)
        ctx.stroke()
render.py 文件源码 项目:iutils 作者: inconvergent 项目源码 文件源码 阅读 27 收藏 0 点赞 0 评论 0
def transparent_pix(self):

    op = self.ctx.get_operator()
    self.ctx.set_operator(OPERATOR_SOURCE)
    self.ctx.set_source_rgba(*[1, 1, 1, 0.95])
    self.dot(1-self.pix, 1.0-self.pix)
    self.ctx.set_operator(op)
fux-terminal.py 文件源码 项目:fux-terminal 作者: fuxprojesi 项目源码 文件源码 阅读 24 收藏 0 点赞 0 评论 0
def area_draw(wid, cr):
        """
        area_draw: Çizim Alan?
        Çizilen pencere alan?nda görsel de?i?iklikler yapmam?z? sa?lar. Pencere'nin
        Arkaplan rengini siyah, görünürlü?ünü'de %90 opak yaparak %10 transparan 
        Olmas?n? sa?lad?k ve ard?ndan cizimin yap?lmas?n? istedik.
        """
        cr.set_source_rgba(0, 0, 0, 0.9)
        cr.set_operator(cairo.OPERATOR_SOURCE)
        cr.paint()
        cr.set_operator(cairo.OPERATOR_OVER)
render.py 文件源码 项目:talks 作者: inconvergent 项目源码 文件源码 阅读 24 收藏 0 点赞 0 评论 0
def transparent_pix(self):

    op = self.ctx.get_operator()
    self.ctx.set_operator(OPERATOR_SOURCE)
    self.ctx.set_source_rgba(*[1, 1, 1, 0.95])
    self.dot(1-self.pix, 1.0-self.pix)
    self.ctx.set_operator(op)
utils.py 文件源码 项目:dogtail 作者: vhumpa 项目源码 文件源码 阅读 21 收藏 0 点赞 0 评论 0
def area_draw(self, widget, cr):  # pragma: no cover
        cr.set_source_rgba(.0, .0, .0, 0.0)
        cr.set_operator(cairo.OPERATOR_SOURCE)
        cr.paint()
        cr.set_operator(cairo.OPERATOR_OVER)
        cr.set_source_rgb(0.9, 0.1, 0.1)
        cr.set_line_width(6)
        cr.rectangle(0, 0, self.get_size()[0], self.get_size()[1])
        cr.stroke()


问题


面经


文章

微信
公众号

扫码关注公众号