mirror of https://github.com/chriskiehl/Gooey.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
607 B
29 lines
607 B
'''
|
|
Utilities for loading, resizing and converting between PIL and WX image formats
|
|
'''
|
|
|
|
import six
|
|
from PIL import Image
|
|
import wx
|
|
|
|
from gooey.gui.three_to_four import imageFromBitmap, bitmapFromImage
|
|
|
|
|
|
|
|
def loadImage(img_path):
|
|
return Image.open(img_path)
|
|
|
|
|
|
def resizeImage(im, targetHeight):
|
|
im.thumbnail((six.MAXSIZE, targetHeight))
|
|
return im
|
|
|
|
|
|
def wrapBitmap(im, parent):
|
|
bitmapData = wx.Bitmap.FromBufferRGBA(im.size[0], im.size[1], im.convert('RGBA').tobytes())
|
|
return wx.StaticBitmap(parent, bitmap=bitmapData)
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
pass
|