windows screenshot fix
This commit is contained in:
parent
54a9cc3de5
commit
2de036f16b
@ -380,7 +380,7 @@ class ScreenShotWindow(QtGui.QWidget):
|
|||||||
self.setMouseTracking(True)
|
self.setMouseTracking(True)
|
||||||
self.setWindowFlags(self.windowFlags() | QtCore.Qt.FramelessWindowHint | QtCore.Qt.WindowStaysOnTopHint)
|
self.setWindowFlags(self.windowFlags() | QtCore.Qt.FramelessWindowHint | QtCore.Qt.WindowStaysOnTopHint)
|
||||||
self.showFullScreen()
|
self.showFullScreen()
|
||||||
self.setWindowOpacity(0.001)
|
self.setWindowOpacity(0.01)
|
||||||
self.rubberband = QtGui.QRubberBand(QtGui.QRubberBand.Rectangle, None)
|
self.rubberband = QtGui.QRubberBand(QtGui.QRubberBand.Rectangle, None)
|
||||||
|
|
||||||
def mousePressEvent(self, event):
|
def mousePressEvent(self, event):
|
||||||
@ -402,10 +402,10 @@ class ScreenShotWindow(QtGui.QWidget):
|
|||||||
rect = self.rubberband.geometry()
|
rect = self.rubberband.geometry()
|
||||||
print rect
|
print rect
|
||||||
p = QtGui.QPixmap.grabWindow(QtGui.QApplication.desktop().winId(),
|
p = QtGui.QPixmap.grabWindow(QtGui.QApplication.desktop().winId(),
|
||||||
rect.x(),
|
rect.x() + 3,
|
||||||
rect.y(),
|
rect.y() + 3,
|
||||||
rect.width(),
|
rect.width() - 6,
|
||||||
rect.height())
|
rect.height() - 6)
|
||||||
byte_array = QtCore.QByteArray()
|
byte_array = QtCore.QByteArray()
|
||||||
buffer = QtCore.QBuffer(byte_array)
|
buffer = QtCore.QBuffer(byte_array)
|
||||||
buffer.open(QtCore.QIODevice.WriteOnly)
|
buffer.open(QtCore.QIODevice.WriteOnly)
|
||||||
|
Loading…
Reference in New Issue
Block a user