Пример #1
0
    def export(self, context, move_x, move_y):
        utils.export_thought_outline(context, self.ul, self.lr,
                                     self.background_color, self.am_selected,
                                     self.am_primary, utils.STYLE_NORMAL,
                                     (move_x, move_y))
        if self.pic:
            raw_pixels = self.pic.get_pixels_array()
            if hasattr(context, "set_source_pixbuf"):
                context.set_source_pixbuf(self.pic,
                                          self.pic_location[0] + move_x,
                                          self.pic_location[1] + move_y)
            elif hasattr(context, "set_source_surface"):
                pixel_array = utils.pixbuf_to_cairo(raw_pixels)
                image_surface = cairo.ImageSurface.create_for_data(
                    pixel_array, cairo.FORMAT_ARGB32, len(raw_pixels[0]),
                    len(raw_pixels), -1)
                context.set_source_surface(image_surface,
                                           self.pic_location[0] + move_x,
                                           self.pic_location[1] + move_y)

            context.rectangle(self.pic_location[0] + move_x,
                              self.pic_location[1] + move_y,
                              len(raw_pixels[0]), len(raw_pixels))
            context.fill()
        context.set_source_rgb(0, 0, 0)
Пример #2
0
    def export(self, context, move_x, move_y):
        utils.export_thought_outline(
            context,
            self.ul,
            self.lr,
            self.background_color,
            self.am_selected,
            self.am_primary,
            utils.STYLE_NORMAL,
            (move_x, move_y),
        )
        cwidth = context.get_line_width()
        context.set_line_width(1)
        if len(self.points) > 0:
            for p in self.points:
                if p.style == STYLE_BEGIN:
                    context.move_to(p.x + move_x, p.y + move_y)
                else:
                    context.line_to(p.x + move_x, p.y + move_y)

        context.set_line_width(cwidth)
        r, g, b = utils.gtk_to_cairo_color(self.foreground_color)
        context.set_source_rgb(r, g, b)
        context.stroke()
        return
Пример #3
0
	def export (self, context, move_x, move_y):
		utils.export_thought_outline (context, self.ul, self.lr, self.background_color, self.am_selected, self.am_primary, utils.STYLE_NORMAL,
									  (move_x, move_y))

		r,g,b = utils.gtk_to_cairo_color (self.foreground_color)
		context.set_source_rgb (r, g, b)
		context.move_to (self.min_x+move_x, self.min_y+move_y)
		context.show_layout (self.layout)
		context.set_source_rgb (0,0,0)
		context.stroke ()
Пример #4
0
 def export (self, context, move_x, move_y):
     utils.export_thought_outline (context, self.ul, self.lr, self.background_color, self.am_selected, self.am_primary, utils.STYLE_NORMAL,
                                                               (move_x, move_y))
     if self.pic:
         if hasattr(context, "set_source_pixbuf"):
             context.set_source_pixbuf (self.pic, self.pic_location[0]+move_x, self.pic_location[1]+move_y)
         else:
             gcontext = gtk.gdk.CairoContext(context)
             gcontext.set_source_pixbuf(self.pic, self.pic_location[0]+move_x, self.pic_location[1]+move_y)
         context.rectangle (self.pic_location[0]+move_x, self.pic_location[1]+move_y, self.width, self.height)
         context.fill ()
     context.set_source_rgb (0,0,0)
Пример #5
0
    def export(self, context, move_x, move_y):
        utils.export_thought_outline(context, self.ul, self.lr,
                                     self.background_color, self.am_selected,
                                     self.am_primary, utils.STYLE_NORMAL,
                                     (move_x, move_y))

        r, g, b = utils.gtk_to_cairo_color(self.foreground_color)
        context.set_source_rgb(r, g, b)
        context.move_to(self.min_x + move_x, self.min_y + move_y)
        ##context.show_layout (self.layout)
        context.set_source_rgb(0, 0, 0)
        context.stroke()
Пример #6
0
 def export (self, context, move_x, move_y):
     utils.export_thought_outline (context, self.ul, self.lr, self.background_color, self.am_selected, self.am_primary, utils.STYLE_NORMAL,
                                                               (move_x, move_y))
     if self.pic:
         if hasattr(context, "set_source_pixbuf"):
             context.set_source_pixbuf (self.pic, self.pic_location[0]+move_x, self.pic_location[1]+move_y)
         elif hasattr(context, "set_source_surface"):
             pixel_array = utils.pixbuf_to_cairo (self.pic.get_pixels_array())
             image_surface = cairo.ImageSurface.create_for_data(pixel_array, cairo.FORMAT_ARGB32, self.width, self.height, -1)
             context.set_source_surface (image_surface, self.pic_location[0]+move_x, self.pic_location[1]+move_y)
         context.rectangle (self.pic_location[0]+move_x, self.pic_location[1]+move_y, self.width, self.height)
         context.fill ()
     context.set_source_rgb (0,0,0)
Пример #7
0
	def export (self, context, move_x, move_y):
		utils.export_thought_outline (context, self.ul, self.lr, self.background_color, self.am_selected, self.am_primary, utils.STYLE_NORMAL,
									  (move_x, move_y))
		cwidth = context.get_line_width ()
		context.set_line_width (1)
		if len (self.points) > 0:
			for p in self.points:
				if p.style == STYLE_BEGIN:
					context.move_to (p.x+move_x, p.y+move_y)
				else:
					context.line_to (p.x+move_x,p.y+move_y)

		context.set_line_width (cwidth)
		r,g,b = utils.gtk_to_cairo_color(self.foreground_color)
		context.set_source_rgb (r, g, b)
		context.stroke ()
		return
Пример #8
0
 def export(self, context, move_x, move_y):
     utils.export_thought_outline(context, self.ul, self.lr,
                                  self.background_color, self.am_selected,
                                  self.am_primary, utils.STYLE_NORMAL,
                                  (move_x, move_y))
     if self.pic:
         if hasattr(context, "set_source_pixbuf"):
             context.set_source_pixbuf(self.pic,
                                       self.pic_location[0] + move_x,
                                       self.pic_location[1] + move_y)
         else:
             gcontext = gtk.gdk.CairoContext(context)
             gcontext.set_source_pixbuf(self.pic,
                                        self.pic_location[0] + move_x,
                                        self.pic_location[1] + move_y)
         context.rectangle(self.pic_location[0] + move_x,
                           self.pic_location[1] + move_y, self.width,
                           self.height)
         context.fill()
     context.set_source_rgb(0, 0, 0)