forked from tritemio/lcos_multispot_pattern
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgen_image_qt5.py
More file actions
39 lines (29 loc) · 811 Bytes
/
gen_image_qt5.py
File metadata and controls
39 lines (29 loc) · 811 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
"""
Show a frameless image in a QT5 window
"""
import sys
from PyQt5 import QtCore, QtGui, QtWidgets
screen_resolution = 1920, 1200
app = QtWidgets.QApplication(sys.argv)
label = QtWidgets.QLabel()
label.setWindowFlags(QtCore.Qt.FramelessWindowHint)
label.resize(800,600)
label.move(0,0)
label.setWindowTitle('LCOS Pattern')
def show_pattern(a):
i = QtGui.QImage(a.tostring(), 800, 600, QtGui.QImage.Format_Indexed8)
p = QtGui.QPixmap.fromImage(i)
label.setPixmap(p)
label.show()
def show_pattern_twin(a, im):
show_pattern(a)
im.set_data(a)
plt.draw()
def clear_pattern():
label.hide()
def move_to_2nd_screen():
label.move(screen_resolution[0], 0)
def move_to_3rd_screen():
label.move(0, screen_resolution[1])
def move_from_other_screen():
label.move(0, 0)