当前位置: 首页>>代码示例>>Python>>正文


Python wx.ImageFromStream方法代码示例

本文整理汇总了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)) 
开发者ID:EventGhost,项目名称:EventGhost,代码行数:20,代码来源:ImagePicker.py

示例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)) 
开发者ID:EventGhost,项目名称:EventGhost,代码行数:20,代码来源:__init__.py

示例3: GetMondrianBitmap

# 需要导入模块: import wx [as 别名]
# 或者: from wx import ImageFromStream [as 别名]
def GetMondrianBitmap():
    stream = GetMondrianStream()
    image = wx.ImageFromStream(stream)
    return wx.BitmapFromImage(image) 
开发者ID:taojy123,项目名称:KeymouseGo,代码行数:6,代码来源:Frame1.py

示例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 
开发者ID:lrq3000,项目名称:pyFileFixity,代码行数:10,代码来源:runsnake.py

示例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) 
开发者ID:tangible-landscape,项目名称:grass-tangible-landscape,代码行数:7,代码来源:wxwrap.py

示例6: getAutoRefreshImage

# 需要导入模块: import wx [as 别名]
# 或者: from wx import ImageFromStream [as 别名]
def getAutoRefreshImage():
    stream = cStringIO.StringIO(getAutoRefreshData())
    return ImageFromStream(stream) 
开发者ID:andreas-p,项目名称:admin4,代码行数:5,代码来源:images.py

示例7: getIconImage

# 需要导入模块: import wx [as 别名]
# 或者: from wx import ImageFromStream [as 别名]
def getIconImage():
    stream = cStringIO.StringIO(getIconData())
    return ImageFromStream(stream) 
开发者ID:andreas-p,项目名称:admin4,代码行数:5,代码来源:images.py

示例8: getLocateImage

# 需要导入模块: import wx [as 别名]
# 或者: from wx import ImageFromStream [as 别名]
def getLocateImage():
    stream = cStringIO.StringIO(getLocateData())
    return ImageFromStream(stream) 
开发者ID:andreas-p,项目名称:admin4,代码行数:5,代码来源:images.py

示例9: getLocateArmedImage

# 需要导入模块: import wx [as 别名]
# 或者: from wx import ImageFromStream [as 别名]
def getLocateArmedImage():
    stream = cStringIO.StringIO(getLocateArmedData())
    return ImageFromStream(stream) 
开发者ID:andreas-p,项目名称:admin4,代码行数:5,代码来源:images.py

示例10: getRefreshImage

# 需要导入模块: import wx [as 别名]
# 或者: from wx import ImageFromStream [as 别名]
def getRefreshImage():
    stream = cStringIO.StringIO(getRefreshData())
    return ImageFromStream(stream) 
开发者ID:andreas-p,项目名称:admin4,代码行数:5,代码来源:images.py

示例11: getToolBitmapButtonImage

# 需要导入模块: import wx [as 别名]
# 或者: from wx import ImageFromStream [as 别名]
def getToolBitmapButtonImage():
    stream = cStringIO.StringIO(getToolBitmapButtonData())
    return ImageFromStream(stream) 
开发者ID:andreas-p,项目名称:admin4,代码行数:5,代码来源:images.py

示例12: getToolBoxSizerImage

# 需要导入模块: import wx [as 别名]
# 或者: from wx import ImageFromStream [as 别名]
def getToolBoxSizerImage():
    stream = cStringIO.StringIO(getToolBoxSizerData())
    return ImageFromStream(stream) 
开发者ID:andreas-p,项目名称:admin4,代码行数:5,代码来源:images.py

示例13: getToolButtonImage

# 需要导入模块: import wx [as 别名]
# 或者: from wx import ImageFromStream [as 别名]
def getToolButtonImage():
    stream = cStringIO.StringIO(getToolButtonData())
    return ImageFromStream(stream) 
开发者ID:andreas-p,项目名称:admin4,代码行数:5,代码来源:images.py

示例14: getToolCheckBoxImage

# 需要导入模块: import wx [as 别名]
# 或者: from wx import ImageFromStream [as 别名]
def getToolCheckBoxImage():
    stream = cStringIO.StringIO(getToolCheckBoxData())
    return ImageFromStream(stream) 
开发者ID:andreas-p,项目名称:admin4,代码行数:5,代码来源:images.py

示例15: getToolCheckListImage

# 需要导入模块: import wx [as 别名]
# 或者: from wx import ImageFromStream [as 别名]
def getToolCheckListImage():
    stream = cStringIO.StringIO(getToolCheckListData())
    return ImageFromStream(stream) 
开发者ID:andreas-p,项目名称:admin4,代码行数:5,代码来源:images.py


注:本文中的wx.ImageFromStream方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。