def CreateBrushIndirect(self): style, r, g, b, hatch = self.get_struct('<hBBBxh') if style == 1: pattern = EmptyPattern else: pattern = SolidPattern(CreateRGBColor(r / 255.0, g / 255.0, b / 255.0)) self.add_gdiobject((('fill_pattern', pattern),)) self._print('->', style, r, g, b, hatch)
def CreatePenIndirect(self): style, widthx, widthy, r, g, b = self.get_struct('<hhhBBBx') cap = (style & 0x0F00) >> 8 join = (style & 0x00F0) >> 4 style = style & 0x000F if style == 5: pattern = EmptyPattern else: pattern = SolidPattern(CreateRGBColor(r / 255.0, g / 255.0, b / 255.0)) width = abs(widthx * self.trafo.m11) self.add_gdiobject((('line_pattern', pattern,), ('line_width', width))) self._print('->', style, widthx, widthy, r, g, b, cap, join)
def lp(self, color=None): if color is None: self.style_obj.line_pattern = self.pattern else: self.style_obj.line_pattern = SolidPattern(color)
def fp(self, color=None): if color is None: self.style_obj.fill_pattern = self.pattern else: self.style_obj.fill_pattern = SolidPattern(color)
def ps(self, color): self.pattern = SolidPattern(color)
def DibCreatePatternBrush(self): self.add_message(_("Bitmap brushes not yet implemented. Using black")) pattern = SolidPattern(StandardColors.black) self.add_gdiobject((('fill_pattern', pattern),))