diff options
author | erikb <erikb@574bc980-5f2d-0410-acbc-c8f9f0eb14e0> | 2007-11-02 20:13:35 (GMT) |
---|---|---|
committer | erikb <erikb@574bc980-5f2d-0410-acbc-c8f9f0eb14e0> | 2007-11-02 20:13:35 (GMT) |
commit | 8ea6fd4da24f05214c65d891bc1ccf02e0752f98 (patch) | |
tree | 65acc190a53d072a7bfe666754a8f81d61017bff /utils.py | |
parent | 16da6678b2a05844ef30de7ee44c756c0c9466e1 (diff) |
nice button gfx...
git-svn-id: http://mediamods.com/public-svn/camera-activity/Record.activity@843 574bc980-5f2d-0410-acbc-c8f9f0eb14e0
Diffstat (limited to 'utils.py')
-rw-r--r-- | utils.py | 20 |
1 files changed, 19 insertions, 1 deletions
@@ -83,4 +83,22 @@ def grayScalePixBuf( pb, copy ): pxl[0][0] = y pxl[1][0] = y pxl[2][0] = y - return gtk.gdk.pixbuf_new_from_array(arr, pb.get_colorspace(), pb.get_bits_per_sample())
\ No newline at end of file + return gtk.gdk.pixbuf_new_from_array(arr, pb.get_colorspace(), pb.get_bits_per_sample()) + + +def convertSvgtoImg( name ): + import instance + import constants + + buttonPath = os.path.join(constants.Constants.gfxPath, name) + buttonDataFile = open(buttonPath, 'r') + buttonData = buttonDataFile.read() + buttonSvg = loadSvg(buttonData, None, None) + buttonDataFile.close() + pb = buttonSvg.get_pixbuf() + imgpath = os.path.join(instance.Instance.tmpPath, "ok.png") + imgpath = getUniqueFilepath( imgpath, 0 ) + pb.save( imgpath, "png" ) + img = gtk.Image() + img.set_from_pixbuf( pb ) + return img
\ No newline at end of file |