- Revision
- 15957
- Author
- grant
- Date
- 2007-11-29 08:31:49 -0800 (Thu, 29 Nov 2007)
Log Message
[APP] Add ocap.wxui.image:get_image (port of ChandlerApp.GetImage())
Modified Paths
Diff
Modified: branches/rearchitecture/Chandler-Platform/ocap/wxui/image.py (15956 => 15957)
--- branches/rearchitecture/Chandler-Platform/ocap/wxui/image.py 2007-11-29 16:30:48 UTC (rev 15956) +++ branches/rearchitecture/Chandler-Platform/ocap/wxui/image.py 2007-11-29 16:31:49 UTC (rev 15957) @@ -6,6 +6,8 @@ imageCache = {} +__all__ = ('get_raw_image', 'get_image') + def get_raw_image(name, copy=True): """ Return None if image isn't found, otherwise return the raw image. @@ -44,3 +46,14 @@ if copy: image = image.Copy() return image + +def get_image(name): + """ + Return None if image isn't found, otherwise loads a bitmap. + Looks first for platform specific bitmaps. + """ + rawImage = get_raw_image(name, copy=False) + if rawImage is not None: + return wx.BitmapFromImage(rawImage) + else: + return None
_______________________________________________ Commits mailing list [email protected] http://lists.osafoundation.org/mailman/listinfo/commits
