MyImageView.py 文件源码

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

项目:pythonista-scripts 作者: khilnani 项目源码 文件源码
def draw(self):
        self.scr_height = self.height
        self.scr_width = self.width
        path = ui.Path.rect(0, 0, self.scr_width, self.scr_height)
        ui.set_color(self.color)
        path.fill()
        self.x_off = (self.scr_width - (self.img_width*self.ratio/self.scr_cor)) / 2
        self.y_off = (self.scr_height - (self.img_height*self.ratio/self.scr_cor)) / 2
        self.img.draw(self.x_off,self.y_off,self.img_width*self.ratio/self.scr_cor,self.img_height*self.ratio/self.scr_cor)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号