本文整理汇总了Python中PySide.QtGui.QImage方法的典型用法代码示例。如果您正苦于以下问题:Python QtGui.QImage方法的具体用法?Python QtGui.QImage怎么用?Python QtGui.QImage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PySide.QtGui
的用法示例。
在下文中一共展示了QtGui.QImage方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_icon
# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QImage [as 别名]
def get_icon(icon, size=24):
"""get svg icon from icon resources folder as a pixel map
"""
img = get_icon_path("{}.svg".format(icon))
svg_renderer = QtSvg.QSvgRenderer(img)
image = QtGui.QImage(size, size, QtGui.QImage.Format_ARGB32)
# Set the ARGB to 0 to prevent rendering artifacts
image.fill(0x00000000)
svg_renderer.render(QtGui.QPainter(image))
pixmap = QtGui.QPixmap.fromImage(image)
return pixmap
示例2: heatmap
# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QImage [as 别名]
def heatmap(self, width, height, points):
base_image = QtGui.QImage(width, height, QtGui.QImage.Format_ARGB32)
base_image.fill(QtGui.QColor(255, 255, 255, 255))
self._paint_points(base_image, points)
return self._qimage_to_pil_image(base_image).convert('L')
示例3: _image_to_clipboard
# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QImage [as 别名]
def _image_to_clipboard(path):
"""Copies the image at path to the system's global clipboard."""
if _in_standalone():
raise Exception("Cannot copy to clipboard from Maya Standalone")
image = QtGui.QImage(path)
clipboard = QtWidgets.QApplication.clipboard()
clipboard.setImage(image, mode=QtGui.QClipboard.Clipboard)
示例4: get_clamav_icon
# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QImage [as 别名]
def get_clamav_icon(return_hex=False, return_pixmap=False):
clamav_icon = ( '89504E470D0A1A0A0000000D494844520000001A0000001A08060000'
'00A94A4CCE000000097048597300000B1300000B1301009A9C180000'
'001974455874536F6674776172650041646F626520496D6167655265'
'61647971C9653C000004A54944415478DABC965F4CDB5514C7BFF7D7'
'5FFFD0C2DA04D8803A680B5306E34F7046972CA1D944F73081FD8926'
'EADC740F2688CB78501F8C913D9810E616E28359E603F3498D89AB31'
'B06571A6304748468031D9A285B4FC29B004C8DA425B28FDFD3CF757'
'685A2819F3CF9ADCFE7EBF7BEF399F7BCE3DE7DCCB6459C653F971D0'
'B0B9C4C29FFF754BD42BACF2DAFE273BE27A45FE770B912C3C535A5F'
'3239EC583FF34A5189A59289F56AC04E9FA675C34E6A8E52D7D0E07A'
'B9FBA4AF13CBB925ABDF8C9BF58ED97AB591A51D4807AB269822D45C'
'586C7A9E896D36269CDCC2CABBFC909BF7B9EE39572195D390BA2FCA'
'C1810EEF58751C5466DED970089A8BEF32DD0CF5557EA78D56EE652A'
'471153199FC44F3EC8E74C2189BB6BB0450EE60E60A5E99E77E2EB38'
'C86C369BC835D3ED6C9B2E1B42E8B22A9C661544BC226AB70CE9892E'
'E3EE4A042724ED7210B2E66DD9CFBBAD5EAFD71307F11FC11C855055'
'5F6219B17D6014913AD596412C1C2581D87B831C587421DA4710FBDA'
'B8901821A3889A3EC32216B8041792B69863526C3E97FB9CE4096230'
'0BE2A5C42971D03E8D1EF9E4AE5E3982F3E0C6D390C0B606A2797C3E'
'97EB21F92A951AAF6BF4875282D218CEAE39AA50A4A857B127CB189A'
'5FAED628AFB3B204DADDFA942011CCCE27EC22AB4EA8F5FF283B8F8A'
'3A940B6A05448A8D676CCF26EFD1416BA185D66FDC4F5156AF4E43E4'
'5F94828FB4E9784F6D4034F6990CA27DB448F4BF5325225310683B93'
'83A02FBC883F97C31B94FE160C20204593FAB2988062D2C3171B5DEF'
'3A89DA0AB5250AF54562388B0A70EDCD23E83368D13A3783D3D363F8'
'39F06803BCE9E18432F6905CF54B55296E57ED818FEBA08586A82D27'
'CC576A1D413C4B040892FFE649E8F8F916ECDABD1BBD3535386DB7A3'
'26DD888F337392407B75067C9A95872F66A7D079B806AD17BE442810'
'C0B5DAE3F07BBD08127029C1338A45BFBB473D61C83E0A6A78E4288C'
'9999CAE05F2E17F2F3F3D13E3480FEDA57B19070760DE56463FF5717'
'F0616323FA87EE2A7D1ABD1E93C545A0BAA7E45448568A6E72D491A9'
'4E3EC87DEBF7FB110E8731363686BADA5A6C379BF1566B0BF21CDF23'
'92978BC94FCEE20DE70D1C3C7614B57575E8EEEE56744CCFCCC0B7B0'
'A0B86F814ADF8F6E572A10DAF88A1963982080DBE3C10C09728BE2B9'
'9695A928297DF940BCCF5250A0CC191F1FC7FCDC1C82BD77F088161C'
'906547CA3CBAED1EE51675F949D195F73FC0FCFC3C8A699F8C2613FE'
'181E56DAF59FAE223035859B97BFC1FD070F94C58497965051518100'
'EDCF0F0D679440A02AEE0BD0B191540B13EF0C2F5A6D954630A71182'
'91E778765929B697976147CE0E4CDDEA41FA9D7E18287C79CD98DDF3'
'1C6CAF1DC636B2F266470742BF3A2191377C1C24CB4D1DEE91B64D41'
'4ACDB3169ECA00DA33485D3A091AE899468D1F186AFA5E2B534A4AC8'
'B110E6A11CA427773D59F26DA77BE4D486EA9EEA16F492D566278043'
'0F66E4101D99A0A5A7B8EA6B96907B1182F0540EC90AECDC0DF74873'
'CA6364B3EBD60B169B49C7589B0E38A921D59A583D8C6FAAA4647E2C'
'4AC9AA2ECA996627EDF3A6E7D5E3EE7504B46818AB276BECE4361381'
'2CD4ED916325C6495639280F071F7B303EAD0BE4DF020C0026BB3556'
'2D86F1AC0000000049454E44AE426082')
if return_hex:
return clamav_icon
image = QtGui.QImage()
image.loadFromData(QtCore.QByteArray.fromHex(clamav_icon))
pixmap = QtGui.QPixmap()
pixmap.convertFromImage(image)
if return_pixmap:
return pixmap
return QtGui.QIcon(pixmap)