c64_painter.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:Pythonista-C64-Painter 作者: superrune 项目源码 文件源码
def redraw_canvas(self, updategrid=False):
        # Gets the pixels covered by the current zoom level
        zoomPixels = self.position_pixels()
        # Redraw view
        self.image_view.image = self.create_new_image()
        with ui.ImageContext(self.width, self.height) as ctx:
            for i in zoomPixels:
                p = self.pixels[i]
                ui.set_color(p.color)
                pixel_path = ui.Path.rect(p.rect[0],p.rect[1],p.rect[2],p.rect[3])
                pixel_path.fill()
                pixel_path.line_width = 0.5
                pixel_path.stroke()
            self.image_view.image = ctx.get_image()
            ## Todo: insert drawing of preview window:
        # Redraw grid
        if updategrid == True:
            self.grid_layout.image = self.draw_grid_image()
            self.grid_layout.alpha = self.gridOpacity
        if self.color_check.hidden is False:
            self.character_colorcheck()
        return True

    # Flip colors
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号