mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-12 18:26:17 +03:00
Merge pull request #5269 from radarhere/fromqimage
This commit is contained in:
commit
53318fbfc1
|
@ -4,8 +4,8 @@
|
||||||
:py:mod:`~PIL.ImageQt` Module
|
:py:mod:`~PIL.ImageQt` Module
|
||||||
=============================
|
=============================
|
||||||
|
|
||||||
The :py:mod:`~PIL.ImageQt` module contains support for creating PyQt5 or PySide2 QImage
|
The :py:mod:`~PIL.ImageQt` module contains support for creating PyQt6, PySide6, PyQt5
|
||||||
objects from PIL images.
|
or PySide2 QImage objects from PIL images.
|
||||||
|
|
||||||
.. versionadded:: 1.1.6
|
.. versionadded:: 1.1.6
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@ objects from PIL images.
|
||||||
Creates an :py:class:`~PIL.ImageQt.ImageQt` object from a PIL
|
Creates an :py:class:`~PIL.ImageQt.ImageQt` object from a PIL
|
||||||
:py:class:`~PIL.Image.Image` object. This class is a subclass of
|
:py:class:`~PIL.Image.Image` object. This class is a subclass of
|
||||||
QtGui.QImage, which means that you can pass the resulting objects directly
|
QtGui.QImage, which means that you can pass the resulting objects directly
|
||||||
to PyQt5/PySide2 API functions and methods.
|
to PyQt6/PySide6/PyQt5/PySide2 API functions and methods.
|
||||||
|
|
||||||
This operation is currently supported for mode 1, L, P, RGB, and RGBA
|
This operation is currently supported for mode 1, L, P, RGB, and RGBA
|
||||||
images. To handle other modes, you need to convert the image first.
|
images. To handle other modes, you need to convert the image first.
|
||||||
|
|
|
@ -63,8 +63,7 @@ def rgb(r, g, b, a=255):
|
||||||
|
|
||||||
def fromqimage(im):
|
def fromqimage(im):
|
||||||
"""
|
"""
|
||||||
:param im: A PIL Image object, or a file name
|
:param im: QImage or PIL ImageQt object
|
||||||
(given either as Python string or a PyQt string object)
|
|
||||||
"""
|
"""
|
||||||
buffer = QBuffer()
|
buffer = QBuffer()
|
||||||
qt_openmode = QIODevice.OpenMode if qt_version == "6" else QIODevice
|
qt_openmode = QIODevice.OpenMode if qt_version == "6" else QIODevice
|
||||||
|
|
Loading…
Reference in New Issue
Block a user