From 1db51734219d25e82c7d03f0084515c8dd70c13f Mon Sep 17 00:00:00 2001 From: Walter Bender Date: Sun, 13 Jan 2013 18:24:42 +0000 Subject: test of moon_pixbuf --- diff --git a/moon.py b/moon.py index 9337d06..6a0e839 100755 --- a/moon.py +++ b/moon.py @@ -293,8 +293,8 @@ class MoonActivity(activity.Activity): self.image_pixbuf = Gdk.pixbuf_get_from_surface(cairo_surface, 0, 0, IMAGE_SIZE, IMAGE_SIZE) #Write pixbuf to Gtk.Image self.image.set_from_pixbuf(self.image_pixbuf) - return + ''' #self.image_pixbuf = cairo_surface(None, IMAGE_SIZE, IMAGE_SIZE) #self.gc = self.image_pixbuf.new_gc(foreground=self.black_alloc_color) #self.image.set_from_pixbuf(self.image_pixbuf, None) @@ -334,11 +334,14 @@ class MoonActivity(activity.Activity): mask_pixbuf.draw_rectangle(wgc, True, 0, 0, HALF_SIZE, IMAGE_SIZE) mask_pixbuf.draw_arc(kgc, True, HALF_SIZE - int(arc_scale / 2), 0, arc_scale, IMAGE_SIZE, 5760, 11520) maskgc = self.image_pixbuf.new_gc(clip_mask=mask_pixbuf) + ''' # Modified image based on public domain photo by John MacCooey moon_pixbuf = self.moon_stamp.scale_simple(IMAGE_SIZE, IMAGE_SIZE, GdkPixbuf.InterpType.BILINEAR) + self.image.set_from_pixbuf(moon_pixbuf) + ''' # Composite bright Moon image and semi-transparant Moon for shadow detail dark_pixbuf = GdkPixbuf.Pixbuf(GdkPixbuf.Colorspace.RGB, True, 8, IMAGE_SIZE, IMAGE_SIZE) dark_pixbuf.fill(0x00000000) @@ -381,7 +384,7 @@ class MoonActivity(activity.Activity): elif self.show_grid: # Draw grid for north hemi self.draw_grid(_("NSEW")) - + ''' self.image.queue_draw() # Update the Moon image in another 5min @@ -699,4 +702,4 @@ class DataModel(): next = time.mktime(time.strptime(date_string[:-1], self.date_format)) if next >= now: return next - now - return -1 \ No newline at end of file + return -1 -- cgit v0.9.1