当前位置: 首页>>代码示例>>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;未经允许,请勿转载。