當前位置: 首頁>>代碼示例>>Python>>正文


Python wx.ImageFromBitmap方法代碼示例

本文整理匯總了Python中wx.ImageFromBitmap方法的典型用法代碼示例。如果您正苦於以下問題:Python wx.ImageFromBitmap方法的具體用法?Python wx.ImageFromBitmap怎麽用?Python wx.ImageFromBitmap使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在wx的用法示例。


在下文中一共展示了wx.ImageFromBitmap方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: load_bitmap

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import ImageFromBitmap [as 別名]
def load_bitmap(resource, size=None):
    bitmap = wx.Bitmap(get_resource(resource), wx.BITMAP_TYPE_PNG)
    if size is not None:
        image = wx.ImageFromBitmap(bitmap)
        image.Rescale(size.GetWidth(), size.GetHeight(),
                      wx.IMAGE_QUALITY_HIGH)
        bitmap = image.ConvertToBitmap()

    return bitmap 
開發者ID:EarToEarOak,項目名稱:RF-Monitor,代碼行數:11,代碼來源:utils_ui.py

示例2: resize_bitmap

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import ImageFromBitmap [as 別名]
def resize_bitmap(parent, _bitmap, target_height):
  '''
  Resizes a bitmap to a height of 89 pixels (the
  size of the top panel), while keeping aspect ratio
  in tact
  '''
  image = wx.ImageFromBitmap(_bitmap)
  _width, _height = image.GetSize()
  if _height < target_height:
    return wx.StaticBitmap(parent, -1, wx.BitmapFromImage(image))
  ratio = float(_width) / _height
  image = image.Scale(target_height * ratio, target_height, wx.IMAGE_QUALITY_HIGH)
  return wx.StaticBitmap(parent, -1, wx.BitmapFromImage(image)) 
開發者ID:ME-ICA,項目名稱:me-ica,代碼行數:15,代碼來源:imageutil.py

示例3: _convert_agg_to_wx_image

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import ImageFromBitmap [as 別名]
def _convert_agg_to_wx_image(agg, bbox):
    """
    Convert the region of the agg buffer bounded by bbox to a wx.Image.  If
    bbox is None, the entire buffer is converted.

    Note: agg must be a backend_agg.RendererAgg instance.
    """
    if bbox is None:
        # agg => rgb -> image
        image = wx.EmptyImage(int(agg.width), int(agg.height))
        image.SetData(agg.tostring_rgb())
        return image
    else:
        # agg => rgba buffer -> bitmap => clipped bitmap => image
        return wx.ImageFromBitmap(_WX28_clipped_agg_as_bitmap(agg, bbox)) 
開發者ID:ktraunmueller,項目名稱:Computable,代碼行數:17,代碼來源:backend_wxagg.py

示例4: _convert_agg_to_wx_image

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import ImageFromBitmap [as 別名]
def _convert_agg_to_wx_image(agg, bbox):
    """
    Convert the region of the agg buffer bounded by bbox to a wx.Image.  If
    bbox is None, the entire buffer is converted.

    Note: agg must be a backend_agg.RendererAgg instance.
    """
    if bbox is None:
        # agg => rgb -> image
        image = wx.Image(int(agg.width), int(agg.height))
        image.SetData(agg.tostring_rgb())
        return image
    else:
        # agg => rgba buffer -> bitmap => clipped bitmap => image
        return wx.ImageFromBitmap(_WX28_clipped_agg_as_bitmap(agg, bbox)) 
開發者ID:Relph1119,項目名稱:GraphicDesignPatternByPython,代碼行數:17,代碼來源:backend_wxagg.py

示例5: imageFromBitmap

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import ImageFromBitmap [as 別名]
def imageFromBitmap(bitmap):
    if isLatestVersion:
        return bitmap.ConvertToImage()
    else:
        return wx.ImageFromBitmap(bitmap) 
開發者ID:chriskiehl,項目名稱:Gooey,代碼行數:7,代碼來源:three_to_four.py

示例6: _convert_agg_to_wx_image

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import ImageFromBitmap [as 別名]
def _convert_agg_to_wx_image(agg, bbox):
    """
    Convert the region of the agg buffer bounded by bbox to a wx.Image.  If
    bbox is None, the entire buffer is converted.

    Note: agg must be a backend_agg.RendererAgg instance.
    """
    if bbox is None:
        # agg => rgb -> image
        image = wxc.EmptyImage(int(agg.width), int(agg.height))
        image.SetData(agg.tostring_rgb())
        return image
    else:
        # agg => rgba buffer -> bitmap => clipped bitmap => image
        return wx.ImageFromBitmap(_WX28_clipped_agg_as_bitmap(agg, bbox)) 
開發者ID:alvarobartt,項目名稱:twitter-stock-recommendation,代碼行數:17,代碼來源:backend_wxagg.py


注:本文中的wx.ImageFromBitmap方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。