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


Python QtGui.QImage方法代码示例

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


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

示例1: _get_application_icon

# 需要导入模块: from PySide2 import QtGui [as 别名]
# 或者: from PySide2.QtGui import QImage [as 别名]
def _get_application_icon() -> QIcon:
        """
        This finds the running blender process, extracts the blender icon from the blender.exe file on disk and saves it to the user's temp folder.
        It then creates a QIcon with that data and returns it.

        Returns QIcon: Application Icon
        """

        icon_filepath = Path(__file__).parent / ".." / "blender_icon_16.png"
        icon = QIcon()

        if icon_filepath.exists():
            image = QImage(str(icon_filepath))
            if not image.isNull():
                icon = QIcon(QPixmap().fromImage(image))

        return icon 
开发者ID:techartorg,项目名称:bqt,代码行数:19,代码来源:blender_application.py

示例2: handleNetworkData

# 需要导入模块: from PySide2 import QtGui [as 别名]
# 或者: from PySide2.QtGui import QImage [as 别名]
def handleNetworkData(self, reply):
        img = QImage()
        tp = Point(reply.request().attribute(QNetworkRequest.User))
        url = reply.url()
        if not reply.error():
            if img.load(reply, None):
                self._tilePixmaps[tp] = QPixmap.fromImage(img)
        reply.deleteLater()
        self.updated.emit(self.tileRect(tp))

        # purge unused tiles
        bound = self._tilesRect.adjusted(-2, -2, 2, 2)
        for tp in list(self._tilePixmaps.keys()):
            if not bound.contains(tp):
                del self._tilePixmaps[tp]
        self.download() 
开发者ID:SanPen,项目名称:GridCal,代码行数:18,代码来源:lightmap.py

示例3: __init__

# 需要导入模块: from PySide2 import QtGui [as 别名]
# 或者: from PySide2.QtGui import QImage [as 别名]
def __init__(self, image = QtGui.QImage(), x = 0, y = 0, width = 0, height = 0):
		super(BitmapData, self).__init__()

		if isinstance(image, QtGui.QImage):
			if stage.app:
				image = QtGui.QPixmap(image)
		elif not isinstance(image, QtGui.QPixmap):
			raise TypeError("BitmapData(image = QtGui.QImage(), x = 0, y = 0, width = 0, height = 0): parameter 'image' must be a QPixmap or QImage object.")

		self.image = image
		self.x = x
		self.y = y
		self.width = width
		self.height = height
		self.__locked = False
		self.__pixelData = []

		if image is not None:
			if width == 0:
				self.width = image.width()

			if height == 0:
				self.height = image.height() 
开发者ID:yuehaowang,项目名称:pylash_engine,代码行数:25,代码来源:display.py

示例4: get_icon

# 需要导入模块: from PySide2 import QtGui [as 别名]
# 或者: from PySide2.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 
开发者ID:mgear-dev,项目名称:mgear_core,代码行数:14,代码来源:pyqt.py

示例5: _image_to_clipboard

# 需要导入模块: from PySide2 import QtGui [as 别名]
# 或者: from PySide2.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) 
开发者ID:bumpybox,项目名称:pyblish-bumpybox,代码行数:10,代码来源:capture.py

示例6: setBackgroundImage

# 需要导入模块: from PySide2 import QtGui [as 别名]
# 或者: from PySide2.QtGui import QImage [as 别名]
def setBackgroundImage(self, image):
        screen = getScreenGeometry()
        pixmap = QPixmap(QImage(image)).scaled(screen.width(), screen.height(), Qt.KeepAspectRatioByExpanding)
        self.label.setPixmap(pixmap)
        self.label.setGeometry(0, 0, screen.width(), self.label.sizeHint().height()) 
开发者ID:codesardine,项目名称:Jade-Application-Kit,代码行数:7,代码来源:Widgets.py

示例7: _show_legend

# 需要导入模块: from PySide2 import QtGui [as 别名]
# 或者: from PySide2.QtGui import QImage [as 别名]
def _show_legend(self):
        pen = QPen(Qt.transparent)

        gradient = self._make_legend_gradient(self.LEGEND_X, self.LEGEND_Y,
                                   self.LEGEND_X, self.LEGEND_Y + self.legend_height)
        brush = QBrush(gradient)
        self.legend = self.scene.addRect(self.LEGEND_X, self.LEGEND_Y,
                                         self.LEGEND_WIDTH, self.legend_height, pen, brush)

        reference_gradient = self._make_legend_gradient(0, 0, self.LEGEND_WIDTH, 1000)
        base_img = QImage(self.LEGEND_WIDTH, 1000, QImage.Format.Format_ARGB32)
        p = QPainter(base_img)
        p.fillRect(base_img.rect(),reference_gradient)
        self.legend_img = base_img #reference shade 
开发者ID:angr,项目名称:angr-management,代码行数:16,代码来源:qtrace_viewer.py

示例8: _loopDraw

# 需要导入模块: from PySide2 import QtGui [as 别名]
# 或者: from PySide2.QtGui import QImage [as 别名]
def _loopDraw(self, c):
		bmpd = self.bitmapData
		image = bmpd.image

		if isinstance(image, QtGui.QPixmap):
			c.drawPixmap(0, 0, image, bmpd.x, bmpd.y, bmpd.width, bmpd.height)
		elif isinstance(image, QtGui.QImage):
			c.drawImage(0, 0, image, bmpd.x, bmpd.y, bmpd.width, bmpd.height) 
开发者ID:yuehaowang,项目名称:pylash_engine,代码行数:10,代码来源:display.py

示例9: doLoad

# 需要导入模块: from PySide2 import QtGui [as 别名]
# 或者: from PySide2.QtGui import QImage [as 别名]
def doLoad(self):
			image = QtGui.QImage()
			image.load(self.path)
			self.resultReady.emit(image) 
开发者ID:yuehaowang,项目名称:pylash_engine,代码行数:6,代码来源:loaders.py


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