當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。