本文整理匯總了Python中wx.ImageFromStream方法的典型用法代碼示例。如果您正苦於以下問題:Python wx.ImageFromStream方法的具體用法?Python wx.ImageFromStream怎麽用?Python wx.ImageFromStream使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類wx
的用法示例。
在下文中一共展示了wx.ImageFromStream方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: SetValue
# 需要導入模塊: import wx [as 別名]
# 或者: from wx import ImageFromStream [as 別名]
def SetValue(self, imageString):
self.imageString = imageString
if imageString:
stream = StringIO(b64decode(imageString))
image = wx.ImageFromStream(stream)
stream.close()
boxWidth, boxHeight = (10, 10)
width, height = image.GetSize()
if width > boxWidth:
height *= 1.0 * boxWidth / width
width = boxWidth
if height > boxHeight:
width *= 1.0 * boxHeight / height
height = boxHeight
image.Rescale(width, height)
bmp = wx.BitmapFromImage(image)
self.imageBox.SetBitmap(bmp)
self.imageBox.SetSize((30, 30))
示例2: SetValue
# 需要導入模塊: import wx [as 別名]
# 或者: from wx import ImageFromStream [as 別名]
def SetValue(self, value):
self.value = value
if value and self.view:
stream = StringIO(b64decode(value))
image = wx.ImageFromStream(stream)
stream.close()
boxWidth, boxHeight = self.view.GetClientSizeTuple()
width, height = image.GetSize()
if width > boxWidth:
height *= 1.0 * boxWidth / width
width = boxWidth
if height > boxHeight:
width *= 1.0 * boxHeight / height
height = boxHeight
image.Rescale(width, height)
bmp = wx.BitmapFromImage(image)
self.view.SetBitmap(bmp)
self.view.SetClientSize((boxWidth, boxHeight))
示例3: GetMondrianBitmap
# 需要導入模塊: import wx [as 別名]
# 或者: from wx import ImageFromStream [as 別名]
def GetMondrianBitmap():
stream = GetMondrianStream()
image = wx.ImageFromStream(stream)
return wx.BitmapFromImage(image)
示例4: getIcon
# 需要導入模塊: import wx [as 別名]
# 或者: from wx import ImageFromStream [as 別名]
def getIcon( data ):
"""Return the data from the resource as a wxIcon"""
import cStringIO
stream = cStringIO.StringIO(data)
image = wx.ImageFromStream(stream)
icon = wx.EmptyIcon()
icon.CopyFromBitmap(wx.BitmapFromImage(image))
return icon
示例5: ImageFromStream
# 需要導入模塊: import wx [as 別名]
# 或者: from wx import ImageFromStream [as 別名]
def ImageFromStream(stream, type=wx.BITMAP_TYPE_ANY, index=-1):
if wxPythonPhoenix:
return wx.Image(stream=stream, type=type, index=index)
else:
return wx.ImageFromStream(stream=stream, type=type, index=index)
示例6: getAutoRefreshImage
# 需要導入模塊: import wx [as 別名]
# 或者: from wx import ImageFromStream [as 別名]
def getAutoRefreshImage():
stream = cStringIO.StringIO(getAutoRefreshData())
return ImageFromStream(stream)
示例7: getIconImage
# 需要導入模塊: import wx [as 別名]
# 或者: from wx import ImageFromStream [as 別名]
def getIconImage():
stream = cStringIO.StringIO(getIconData())
return ImageFromStream(stream)
示例8: getLocateImage
# 需要導入模塊: import wx [as 別名]
# 或者: from wx import ImageFromStream [as 別名]
def getLocateImage():
stream = cStringIO.StringIO(getLocateData())
return ImageFromStream(stream)
示例9: getLocateArmedImage
# 需要導入模塊: import wx [as 別名]
# 或者: from wx import ImageFromStream [as 別名]
def getLocateArmedImage():
stream = cStringIO.StringIO(getLocateArmedData())
return ImageFromStream(stream)
示例10: getRefreshImage
# 需要導入模塊: import wx [as 別名]
# 或者: from wx import ImageFromStream [as 別名]
def getRefreshImage():
stream = cStringIO.StringIO(getRefreshData())
return ImageFromStream(stream)
示例11: getToolBitmapButtonImage
# 需要導入模塊: import wx [as 別名]
# 或者: from wx import ImageFromStream [as 別名]
def getToolBitmapButtonImage():
stream = cStringIO.StringIO(getToolBitmapButtonData())
return ImageFromStream(stream)
示例12: getToolBoxSizerImage
# 需要導入模塊: import wx [as 別名]
# 或者: from wx import ImageFromStream [as 別名]
def getToolBoxSizerImage():
stream = cStringIO.StringIO(getToolBoxSizerData())
return ImageFromStream(stream)
示例13: getToolButtonImage
# 需要導入模塊: import wx [as 別名]
# 或者: from wx import ImageFromStream [as 別名]
def getToolButtonImage():
stream = cStringIO.StringIO(getToolButtonData())
return ImageFromStream(stream)
示例14: getToolCheckBoxImage
# 需要導入模塊: import wx [as 別名]
# 或者: from wx import ImageFromStream [as 別名]
def getToolCheckBoxImage():
stream = cStringIO.StringIO(getToolCheckBoxData())
return ImageFromStream(stream)
示例15: getToolCheckListImage
# 需要導入模塊: import wx [as 別名]
# 或者: from wx import ImageFromStream [as 別名]
def getToolCheckListImage():
stream = cStringIO.StringIO(getToolCheckListData())
return ImageFromStream(stream)