本文整理汇总了Python中wx.BITMAP_TYPE_PNG属性的典型用法代码示例。如果您正苦于以下问题:Python wx.BITMAP_TYPE_PNG属性的具体用法?Python wx.BITMAP_TYPE_PNG怎么用?Python wx.BITMAP_TYPE_PNG使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类wx
的用法示例。
在下文中一共展示了wx.BITMAP_TYPE_PNG属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: OnAbout
# 需要导入模块: import wx [as 别名]
# 或者: from wx import BITMAP_TYPE_PNG [as 别名]
def OnAbout(self, evt):
"""About GoSync"""
if wxgtk4 :
about = wx.adv.AboutDialogInfo()
else:
about = wx.AboutDialogInfo()
about.SetIcon(wx.Icon(ABOUT_ICON, wx.BITMAP_TYPE_PNG))
about.SetName(APP_NAME)
about.SetVersion(APP_VERSION)
about.SetDescription(APP_DESCRIPTION)
about.SetCopyright(APP_COPYRIGHT)
about.SetWebSite(APP_WEBSITE)
about.SetLicense(APP_LICENSE)
about.AddDeveloper(APP_DEVELOPER)
about.AddArtist(ART_DEVELOPER)
if wxgtk4 :
wx.adv.AboutBox(about)
else:
wx.AboutBox(about)
示例2: saveImage
# 需要导入模块: import wx [as 别名]
# 或者: from wx import BITMAP_TYPE_PNG [as 别名]
def saveImage(self, bmp, filename, folder, prefix, format='jpg'):
# convert
img = bmp.ConvertToImage()
# save
if format == 'gif':
fileName = os.path.join(folder,"%s%s.gif" % (prefix, filename))
img.SaveFile(fileName, wx.BITMAP_TYPE_GIF)
elif format == 'png':
fileName = os.path.join(folder,"%s%s.png" % (prefix, filename))
img.SaveFile(fileName, wx.BITMAP_TYPE_PNG)
else:
fileName = os.path.join(folder,"%s%s.jpg" % (prefix, filename))
img.SaveFile(fileName, wx.BITMAP_TYPE_JPEG)
示例3: layoutComponent
# 需要导入模块: import wx [as 别名]
# 或者: from wx import BITMAP_TYPE_PNG [as 别名]
def layoutComponent(self):
sizer = wx.BoxSizer(wx.VERTICAL)
sizer.Add(self.header, 0, wx.EXPAND)
sizer.Add(wx_util.horizontal_rule(self), 0, wx.EXPAND)
sizer.Add(self.navbar, 1, wx.EXPAND)
sizer.Add(self.console, 1, wx.EXPAND)
sizer.Add(wx_util.horizontal_rule(self), 0, wx.EXPAND)
sizer.Add(self.footer, 0, wx.EXPAND)
self.SetMinSize((400, 300))
self.SetSize(self.buildSpec['default_size'])
self.SetSizer(sizer)
self.console.Hide()
self.Layout()
if self.buildSpec.get('fullscreen', True):
self.ShowFullScreen(True)
# Program Icon (Windows)
icon = wx.Icon(self.buildSpec['images']['programIcon'], wx.BITMAP_TYPE_PNG)
self.SetIcon(icon)
if sys.platform != 'win32':
# OSX needs to have its taskbar icon explicitly set
# bizarrely, wx requires the TaskBarIcon to be attached to the Frame
# as instance data (self.). Otherwise, it will not render correctly.
self.taskbarIcon = TaskBarIcon(iconType=wx.adv.TBI_DOCK)
self.taskbarIcon.SetIcon(icon)
示例4: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import BITMAP_TYPE_PNG [as 别名]
def __init__(self, parent, id, evtList, ix, plugin):
width = 205
wx.ListCtrl.__init__(self, parent, id, style=wx.LC_REPORT |
wx.LC_NO_HEADER | wx.LC_SINGLE_SEL, size = (width, -1))
self.parent = parent
self.id = id
self.evtList = evtList
self.ix = ix
self.plugin = plugin
self.sel = -1
self.il = wx.ImageList(16, 16)
self.il.Add(wx.BitmapFromImage(wx.Image(join(eg.imagesDir, "event.png"), wx.BITMAP_TYPE_PNG)))
self.SetImageList(self.il, wx.IMAGE_LIST_SMALL)
self.InsertColumn(0, '')
self.SetColumnWidth(0, width - 5 - SYS_VSCROLL_X)
self.Bind(wx.EVT_LIST_ITEM_SELECTED, self.OnSelect)
self.Bind(wx.EVT_SET_FOCUS, self.OnChange)
self.Bind(wx.EVT_LIST_INSERT_ITEM, self.OnChange)
self.Bind(wx.EVT_LIST_ITEM_DESELECTED, self.OnChange)
self.Bind(wx.EVT_LIST_ITEM_RIGHT_CLICK, self.OnRightClick)
self.SetToolTipString(self.plugin.text.toolTip)
示例5: load_bitmap
# 需要导入模块: import wx [as 别名]
# 或者: from wx import BITMAP_TYPE_PNG [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
示例6: saveImageGL
# 需要导入模块: import wx [as 别名]
# 或者: from wx import BITMAP_TYPE_PNG [as 别名]
def saveImageGL(mvcanvas, filename):
view = glGetIntegerv(GL_VIEWPORT)
img = wx.EmptyImage(view[2], view[3] )
pixels = glReadPixels(0, 0, view[2], view[3], GL_RGB,
GL_UNSIGNED_BYTE)
img.SetData( pixels )
img = img.Mirror(False)
img.SaveFile(filename, wx.BITMAP_TYPE_PNG)
示例7: saveImage
# 需要导入模块: import wx [as 别名]
# 或者: from wx import BITMAP_TYPE_PNG [as 别名]
def saveImage(canvas, filename):
s = wx.ScreenDC()
w, h = canvas.size.Get()
b = wx.EmptyBitmap(w, h)
m = wx.MemoryDCFromDC(s)
m.SelectObject(b)
m.Blit(0, 0, w, h, s, 70, 0)
m.SelectObject(wx.NullBitmap)
b.SaveFile(filename, wx.BITMAP_TYPE_PNG)
示例8: About
# 需要导入模块: import wx [as 别名]
# 或者: from wx import BITMAP_TYPE_PNG [as 别名]
def About(self, e):
dialog = wx.AboutDialogInfo()
#dialog.SetIcon (wx.Icon('icon.ico', wx.BITMAP_TYPE_PNG))
dialog.SetIcon(self.icon)
dialog.SetName(self.application.title+': '+self.application.long_title)
dialog.SetVersion(self.application.version)
dialog.SetCopyright(self.application.c)
dialog.SetDescription('\n'.join(map(lambda x: x[4:], self.application.about.split('\n')[1:][:-1])))
dialog.SetWebSite(self.application.url)
dialog.SetLicence(self.application.license)
wx.AboutBox(dialog)
示例9: About
# 需要导入模块: import wx [as 别名]
# 或者: from wx import BITMAP_TYPE_PNG [as 别名]
def About(self, e):
dialog = wx.AboutDialogInfo()
#dialog.SetIcon (wx.Icon('icon.ico', wx.BITMAP_TYPE_PNG))
dialog.SetIcon(self.icon)
#dialog.SetName(self.application.long_title+' - '+self.application.title)
dialog.SetName('Yaml Editor - Yamled')
dialog.SetVersion(self.application.version)
dialog.SetCopyright(self.application.c)
#dialog.SetDescription('\n'.join(map(lambda x: x[4:], self.application.about.split('\n')[1:][:-1])))
dialog.SetDescription('\n'.join([
'',
'This editor is developed as part of report-ng project.',
'',
'It supports only basic functionality.',
'This include:',
'- Opening (drag & drop is supported), saving and closing yaml file',
'- Tree view of yaml structure',
'- Editing values',
'- Adding new child node or structure (limited capability)',
'- Deleting node or subtree',
'',
'In other words - the tool is intended to simplify work with yaml files, ',
'not to allow designing them from scratch.']))
#dialog.SetWebSite(self.application.url)
#dialog.SetLicence(self.application.license)
wx.AboutBox(dialog)
示例10: print_png
# 需要导入模块: import wx [as 别名]
# 或者: from wx import BITMAP_TYPE_PNG [as 别名]
def print_png(self, filename, *args, **kwargs):
return self._print_image(filename, wx.BITMAP_TYPE_PNG, *args, **kwargs)
示例11: on_about
# 需要导入模块: import wx [as 别名]
# 或者: from wx import BITMAP_TYPE_PNG [as 别名]
def on_about(self, event):
"""Opens About dialog."""
# Credit for AboutDiaglog example to Jan Bodnar of
# http://zetcode.com/wxpython/dialogs/
description = (
"Superpaper is an advanced multi monitor wallpaper\n"
+"manager for Unix and Windows operating systems.\n"
+"Features include setting a single or multiple image\n"
+"wallpaper, pixel per inch and bezel corrections,\n"
+"manual pixel offsets for tuning, slideshow with\n"
+"configurable file order, multiple path support and more."
)
licence = (
"Superpaper is free software; you can redistribute\n"
+"it and/or modify it under the terms of the MIT"
+" License.\n\n"
+"Superpaper is distributed in the hope that it will"
+" be useful,\n"
+"but WITHOUT ANY WARRANTY; without even the implied"
+" warranty of\n"
+"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n"
+"See the MIT License for more details."
)
artists = "Icons kindly provided by Icons8 https://icons8.com"
info = wx.adv.AboutDialogInfo()
info.SetIcon(wx.Icon(TRAY_ICON, wx.BITMAP_TYPE_PNG))
info.SetName('Superpaper')
info.SetVersion(__version__)
info.SetDescription(description)
info.SetCopyright('(C) 2020 Henri Hänninen')
info.SetWebSite('https://github.com/hhannine/Superpaper/')
info.SetLicence(licence)
info.AddDeveloper('Henri Hänninen')
info.AddArtist(artists)
# info.AddDocWriter('Doc Writer')
# info.AddTranslator('Tran Slator')
wx.adv.AboutBox(info)
示例12: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import BITMAP_TYPE_PNG [as 别名]
def __init__(self, parent=None):
wx.Frame.__init__(self, parent=parent, title="Superpaper Help")
self.frame_sizer = wx.BoxSizer(wx.VERTICAL)
help_panel = HelpPanel(self)
self.frame_sizer.Add(help_panel, 1, wx.EXPAND)
self.SetAutoLayout(True)
self.SetSizer(self.frame_sizer)
self.SetIcon(wx.Icon(TRAY_ICON, wx.BITMAP_TYPE_PNG))
self.Fit()
self.Layout()
self.Center()
self.Show()
示例13: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import BITMAP_TYPE_PNG [as 别名]
def __init__(self, parent_tray_obj):
wx.Frame.__init__(self, parent=None, title="Superpaper Wallpaper Configuration")
self.frame_sizer = wx.BoxSizer(wx.VERTICAL)
config_panel = WallpaperSettingsPanel(self, parent_tray_obj)
self.frame_sizer.Add(config_panel, 1, wx.EXPAND)
self.SetAutoLayout(True)
self.SetSizer(self.frame_sizer)
self.SetMinSize((600,600))
self.SetIcon(wx.Icon(TRAY_ICON, wx.BITMAP_TYPE_PNG))
self.Fit()
self.Layout()
self.Center()
self.Show()
示例14: check_for_bom_button
# 需要导入模块: import wx [as 别名]
# 或者: from wx import BITMAP_TYPE_PNG [as 别名]
def check_for_bom_button():
# From Miles McCoo's blog
# https://kicad.mmccoo.com/2017/03/05/adding-your-own-command-buttons-to-the-pcbnew-gui/
def find_pcbnew_window():
windows = wx.GetTopLevelWindows()
pcbneww = [w for w in windows if "pcbnew" in w.GetTitle().lower()]
if len(pcbneww) != 1:
return None
return pcbneww[0]
def callback(_):
plugin.Run()
path = os.path.dirname(__file__)
while not wx.GetApp():
time.sleep(1)
bm = wx.Bitmap(path + '/icon.png', wx.BITMAP_TYPE_PNG)
button_wx_item_id = 0
from pcbnew import ID_H_TOOLBAR
while True:
time.sleep(1)
pcbnew_window = find_pcbnew_window()
if not pcbnew_window:
continue
top_tb = pcbnew_window.FindWindowById(ID_H_TOOLBAR)
if button_wx_item_id == 0 or not top_tb.FindTool(button_wx_item_id):
top_tb.AddSeparator()
button_wx_item_id = wx.NewId()
top_tb.AddTool(button_wx_item_id, "iBOM", bm,
"Generate interactive BOM", wx.ITEM_NORMAL)
top_tb.Bind(wx.EVT_TOOL, callback, id=button_wx_item_id)
top_tb.Realize()
示例15: create_bitmap
# 需要导入模块: import wx [as 别名]
# 或者: from wx import BITMAP_TYPE_PNG [as 别名]
def create_bitmap(path, max_width, max_height, edges):
app = wx.App(None)
nodes = layout.layout(edges)
bitmap = render.render(max_width, max_height, edges, nodes)
bitmap.SaveFile(path, wx.BITMAP_TYPE_PNG)