A screenshot module writen in python with pyQt5.
||tool for drawing rectangle|
||tool for drawing ellipse|
||tool for drawing line|
||tool for drawing freely|
||tool for adding text|
||tool for drawing arrow|
||tool for saving to clipboard|
||tool for saving to file|
You can take some simple changes after taking a screenshot without opening an image editor.
Save image as png or jpg file, or cpoy to clipboard
from pyqt_screenshot.screenshot import Screenshot, constant img = Screenshot.take_screenshot(constant.CLIPBOARD) # QImage or None
None will be returned if canceled.
import sys from PyQt5.QtGui import QPixmap from PyQt5.QtWidgets import QApplication, QLabel from pyqt_screenshot.screenshot import Screenshot, constant if __name__ == "__main__": qtApp = QApplication(sys.argv) main_window = QLabel() img = Screenshot.take_screenshot(constant.CLIPBOARD | constant.LINE) main_window.show() if img is not None: main_window.setPixmap(QPixmap(img)) qtApp.exec()
Before starting, you should make sure you have python and pyqt5 installed.
Line and Pen
Can't save screenshot to clipboard on Linux because the clipboard on Linux only stores the reference to the picture object, which means the clipboard can't hold the screenshot after closing the screenshot.