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


Python wx.IconFromBitmap方法代码示例

本文整理汇总了Python中wx.IconFromBitmap方法的典型用法代码示例。如果您正苦于以下问题:Python wx.IconFromBitmap方法的具体用法?Python wx.IconFromBitmap怎么用?Python wx.IconFromBitmap使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在wx的用法示例。


在下文中一共展示了wx.IconFromBitmap方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: mySetIcons

# 需要导入模块: import wx [as 别名]
# 或者: from wx import IconFromBitmap [as 别名]
def mySetIcons(self):
        wx.Image_AddHandler(wx.PNGHandler())

        ib = wx.IconBundle()

        for sz in ("16", "32", "64", "128", "256"):
            ib.AddIcon(wx.IconFromBitmap(misc.getBitmap("resources/icon%s.png" % sz)))

        self.SetIcons(ib) 
开发者ID:trelby,项目名称:trelby,代码行数:11,代码来源:trelby.py

示例2: MakeIcon

# 需要导入模块: import wx [as 别名]
# 或者: from wx import IconFromBitmap [as 别名]
def MakeIcon(self, img):
        """
        The various platforms have different requirements for the
        icon size...
        """
        if "wxMSW" in wx.PlatformInfo:
            img = img.Scale(16, 16)
        elif "wxGTK" in wx.PlatformInfo:
            img = img.Scale(22, 22)
        # wxMac can be any size upto 128x128, so leave the source img alone....
        icon = wx.IconFromBitmap(img.ConvertToBitmap() )
        return icon 
开发者ID:peckhams,项目名称:topoflow,代码行数:14,代码来源:Dock_Bar_Example.py

示例3: MakeIcon

# 需要导入模块: import wx [as 别名]
# 或者: from wx import IconFromBitmap [as 别名]
def MakeIcon(self, img):
                """
                The various platforms have different requirements for the
                icon size...
                """
                if "wxMSW" in wx.PlatformInfo:
                    img = img.Scale(16, 16)
                elif "wxGTK" in wx.PlatformInfo:
                    img = img.Scale(22, 22)
                # wxMac can be any size upto 128x128, so leave the source img alone....
                icon = wx.IconFromBitmap(img.ConvertToBitmap())
                return icon 
开发者ID:thiagoralves,项目名称:OpenPLC_Editor,代码行数:14,代码来源:Beremiz_service.py

示例4: __init__

# 需要导入模块: import wx [as 别名]
# 或者: from wx import IconFromBitmap [as 别名]
def __init__(self, num, fig):
        # On non-Windows platform, explicitly set the position - fix
        # positioning bug on some Linux platforms
        if wx.Platform == '__WXMSW__':
            pos = wx.DefaultPosition
        else:
            pos =wx.Point(20,20)
        l,b,w,h = fig.bbox.bounds
        wx.Frame.__init__(self, parent=None, id=-1, pos=pos,
                          title="Figure %d" % num)
        # Frame will be sized later by the Fit method
        DEBUG_MSG("__init__()", 1, self)
        self.num = num

        statbar = StatusBarWx(self)
        self.SetStatusBar(statbar)
        self.canvas = self.get_canvas(fig)
        self.canvas.SetInitialSize(wx.Size(fig.bbox.width, fig.bbox.height))
        self.canvas.SetFocus()
        self.sizer =wx.BoxSizer(wx.VERTICAL)
        self.sizer.Add(self.canvas, 1, wx.TOP | wx.LEFT | wx.EXPAND)
        # By adding toolbar in sizer, we are able to put it at the bottom
        # of the frame - so appearance is closer to GTK version

        self.toolbar = self._get_toolbar(statbar)

        if self.toolbar is not None:
            self.toolbar.Realize()
            # On Windows platform, default window size is incorrect, so set
            # toolbar width to figure width.
            tw, th = self.toolbar.GetSizeTuple()
            fw, fh = self.canvas.GetSizeTuple()
            # By adding toolbar in sizer, we are able to put it at the bottom
            # of the frame - so appearance is closer to GTK version.
            self.toolbar.SetSize(wx.Size(fw, th))
            self.sizer.Add(self.toolbar, 0, wx.LEFT | wx.EXPAND)
        self.SetSizer(self.sizer)
        self.Fit()

        self.canvas.SetMinSize((2, 2))

        # give the window a matplotlib icon rather than the stock one.
        # This is not currently working on Linux and is untested elsewhere.
        #icon_path = os.path.join(matplotlib.rcParams['datapath'],
        #                         'images', 'matplotlib.png')
        #icon = wx.IconFromBitmap(wx.Bitmap(icon_path))
        # for xpm type icons try:
        #icon = wx.Icon(icon_path, wx.BITMAP_TYPE_XPM)
        #self.SetIcon(icon)

        self.figmgr = FigureManagerWx(self.canvas, num, self)

        bind(self, wx.EVT_CLOSE, self._onClose) 
开发者ID:ktraunmueller,项目名称:Computable,代码行数:55,代码来源:backend_wx.py

示例5: __init__

# 需要导入模块: import wx [as 别名]
# 或者: from wx import IconFromBitmap [as 别名]
def __init__(self, num, fig):
        # On non-Windows platform, explicitly set the position - fix
        # positioning bug on some Linux platforms
        if wx.Platform == '__WXMSW__':
            pos = wx.DefaultPosition
        else:
            pos = wx.Point(20, 20)
        l, b, w, h = fig.bbox.bounds
        wx.Frame.__init__(self, parent=None, id=-1, pos=pos,
                          title="Figure %d" % num)
        # Frame will be sized later by the Fit method
        DEBUG_MSG("__init__()", 1, self)
        self.num = num

        statbar = StatusBarWx(self)
        self.SetStatusBar(statbar)
        self.canvas = self.get_canvas(fig)
        self.canvas.SetInitialSize(wx.Size(fig.bbox.width, fig.bbox.height))
        self.canvas.SetFocus()
        self.sizer = wx.BoxSizer(wx.VERTICAL)
        self.sizer.Add(self.canvas, 1, wx.TOP | wx.LEFT | wx.EXPAND)
        # By adding toolbar in sizer, we are able to put it at the bottom
        # of the frame - so appearance is closer to GTK version

        self.toolbar = self._get_toolbar(statbar)

        if self.toolbar is not None:
            self.toolbar.Realize()
            # On Windows platform, default window size is incorrect, so set
            # toolbar width to figure width.
            if wxc.is_phoenix:
                tw, th = self.toolbar.GetSize()
                fw, fh = self.canvas.GetSize()
            else:
                tw, th = self.toolbar.GetSizeTuple()
                fw, fh = self.canvas.GetSizeTuple()
            # By adding toolbar in sizer, we are able to put it at the bottom
            # of the frame - so appearance is closer to GTK version.
            self.toolbar.SetSize(wx.Size(fw, th))
            self.sizer.Add(self.toolbar, 0, wx.LEFT | wx.EXPAND)
        self.SetSizer(self.sizer)
        self.Fit()

        self.canvas.SetMinSize((2, 2))

        # give the window a matplotlib icon rather than the stock one.
        # This is not currently working on Linux and is untested elsewhere.
        # icon_path = os.path.join(matplotlib.rcParams['datapath'],
        #                         'images', 'matplotlib.png')
        # icon = wx.IconFromBitmap(wx.Bitmap(icon_path))
        #  for xpm type icons try:
        # icon = wx.Icon(icon_path, wx.BITMAP_TYPE_XPM)
        #  self.SetIcon(icon)

        self.figmgr = FigureManagerWx(self.canvas, num, self)

        self.Bind(wx.EVT_CLOSE, self._onClose) 
开发者ID:alvarobartt,项目名称:twitter-stock-recommendation,代码行数:59,代码来源:backend_wx.py


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