当前位置: 首页>>代码示例>>Python>>正文


Python Group.skew方法代码示例

本文整理汇总了Python中reportlab.graphics.shapes.Group.skew方法的典型用法代码示例。如果您正苦于以下问题:Python Group.skew方法的具体用法?Python Group.skew怎么用?Python Group.skew使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在reportlab.graphics.shapes.Group的用法示例。


在下文中一共展示了Group.skew方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: draw

# 需要导入模块: from reportlab.graphics.shapes import Group [as 别名]
# 或者: from reportlab.graphics.shapes.Group import skew [as 别名]
    def draw(self):
        fillColor = self.fillColor
        strokeColor = self.strokeColor
        g = Group()
        bg = self.background
        bd = self.border
        bdw = self.borderWidth
        shadow = self.shadow
        x, y = self.x, self.y
        if bg:
            if shadow is not None and 0<=shadow<1:
                shadow = Color(bg.red*shadow,bg.green*shadow,bg.blue*shadow)
            self._paintLogo(g,dy=-2.5, dx=2,fillColor=shadow)
        self._paintLogo(g,fillColor=fillColor,strokeColor=strokeColor)
        g.skew(kx=self.skewX, ky=self.skewY)
        g.shift(self._dx,self._dy)
        G = Group()
        G.add(g)
        _w, _h = 130, 86
        w, h = self.width, self.height
        if bg or (bd and bdw):
            G.insert(0,Rect(0,0,_w,_h,fillColor=bg,strokeColor=bd,strokeWidth=bdw))
        if w!=_w or h!=_h: G.scale(w/float(_w),h/float(_h))

        angle = self.angle
        if self.angle:
            w, h = w/2., h/2.
            G.shift(-w,-h)
            G.rotate(angle)
            G.shift(w,h)
        G.shift(x,y)
        return G
开发者ID:broodjeaap,项目名称:project-78-hr-2011-groep1,代码行数:34,代码来源:corp.py

示例2: draw

# 需要导入模块: from reportlab.graphics.shapes import Group [as 别名]
# 或者: from reportlab.graphics.shapes.Group import skew [as 别名]
    def draw(self):
        fillColor = self.fillColor
        strokeColor = self.strokeColor
        g = Group()
        bg = self.background
        bd = self.border
        bdw = self.borderWidth
        shadow = self.shadow
        x, y = self.x, self.y
        if bg:
            if shadow is not None and 0 <= shadow < 1:
                shadow = Color(bg.red * shadow, bg.green * shadow, bg.blue * shadow)
            self._paintLogo(g, dy=-2.5, dx=2, fillColor=shadow)
        self._paintLogo(
            g,
            fillColor=fillColor,
            strokeColor=strokeColor,
            _ocolors=getattr(self, "_ocolors", None),
            _pagecolors=getattr(self, "_pagecolors", None),
        )
        g.skew(kx=self.skewX, ky=self.skewY)
        g.shift(self._dx, self._dy)
        G = Group()
        G.add(g)
        _w, _h = 130, 86
        w, h = self.width, self.height
        if bg or (bd and bdw):
            G.insert(0, Rect(0, 0, _w, _h, fillColor=bg, strokeColor=bd, strokeWidth=bdw))
        if w != _w or h != _h:
            G.scale(w / float(_w), h / float(_h))

        angle = self.angle
        if self.angle:
            w, h = w / 2.0, h / 2.0
            G.shift(-w, -h)
            G.rotate(angle)
            G.shift(w, h)
        xFlip = getattr(self, "xFlip", 0) and -1 or 0
        yFlip = getattr(self, "yFlip", 0) and -1 or 0
        if xFlip or yFlip:
            sx = xFlip or 1
            sy = yFlip or 1
            G.shift(sx * x + w * xFlip, sy * y + yFlip * h)
            G = Group(G, transform=(sx, 0, 0, sy, 0, 0))
        else:
            G.shift(x, y)
        return G
开发者ID:FatihZor,项目名称:infernal-twin,代码行数:49,代码来源:corp.py


注:本文中的reportlab.graphics.shapes.Group.skew方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。