diff options
author | erikb <erikb@574bc980-5f2d-0410-acbc-c8f9f0eb14e0> | 2007-11-03 01:39:39 (GMT) |
---|---|---|
committer | erikb <erikb@574bc980-5f2d-0410-acbc-c8f9f0eb14e0> | 2007-11-03 01:39:39 (GMT) |
commit | 06708f120d93bc952979192a7ee16a6c5d102a08 (patch) | |
tree | 24cb2f3b637c890d8df5b106c42ea94d2b17d49e /constants.py | |
parent | e0f85a86cf2055e0d978279ef2c0450b5ffd4c7c (diff) |
damn numbers
git-svn-id: http://mediamods.com/public-svn/camera-activity/Record.activity@856 574bc980-5f2d-0410-acbc-c8f9f0eb14e0
Diffstat (limited to 'constants.py')
-rw-r--r-- | constants.py | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/constants.py b/constants.py index 0129c9c..20c6728 100644 --- a/constants.py +++ b/constants.py @@ -232,10 +232,16 @@ class Constants: def createCountdownPng( self, num ): + todisk = True + w = self.__class__.dim_CONTROLBAR_HT h = w - img = cairo.ImageSurface(cairo.FORMAT_ARGB32, w, h) - ctx = cairo.Context(img) + if (todisk): + cimg = cairo.ImageSurface(cairo.FORMAT_ARGB32, w, h) + ctx = cairo.Context(cimg) + else: + pixmap = gtk.gdk.Pixmap(None, w, h, 24) + ctx = pixmap.cairo_create() ctx.rectangle(0, 0, w, h) ctx.set_source_rgb(0, 0, 0) ctx.fill() @@ -259,11 +265,14 @@ class Constants: ctx.translate( xoff, yoff ) pctx.show_layout(play) - path = os.path.join(Instance.tmpPath, str(num)+".png") - path = utils.getUniqueFilepath(path, 0) - img.write_to_png(path) - img = gtk.Image() - numPixbuf = gtk.gdk.pixbuf_new_from_file(path) - img.set_from_pixbuf( numPixbuf ) + if (todisk): + path = os.path.join(Instance.tmpPath, str(num)+".png") + path = utils.getUniqueFilepath(path, 0) + cimg.write_to_png(path) + numPixbuf = gtk.gdk.pixbuf_new_from_file(path) + img.set_from_pixbuf( numPixbuf ) + else: + img.set_from_pixmap(pixmap, None) + self.__class__.countdownImgs[int(num)] = img
\ No newline at end of file |