本文整理汇总了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)