c64_painter.py 文件源码

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

项目:Pythonista-C64-Painter 作者: superrune 项目源码 文件源码
def create_zoom_frame(self):
        zoomWidth = self.width / self.zoomLevels[self.zoomCurrent]
        zoomHeight = self.height / self.zoomLevels[self.zoomCurrent]
        # create an movable image showing the zoom area
        with ui.ImageContext(320,200) as ctx:
            ui.set_color('black')
            line_inside = ui.Path.rect(2,2,316,196)
            line_inside.line_width = 4
            line_inside.stroke()
            ui.set_color('white')
            line_outside = ui.Path.rect(0,0,320,200)
            line_outside.line_width = 4
            line_outside.stroke()
            zoomSquare = ctx.get_image()
        zoom_frame = ui.ImageView(hidden=True)
        zoom_frame.bounds = (0,0,zoomWidth,zoomHeight)
        zoom_frame.center = (self.width/2, self.height/2)
        zoom_frame.image = zoomSquare
        self.add_subview(zoom_frame)
        return zoom_frame
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号