Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
P
Python-Roadshow
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
workshops
Python-Roadshow
Commits
f8ae4ea1
Commit
f8ae4ea1
authored
Jan 19, 2018
by
Wichit Sombat
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'superk'
parents
c4932e82
feaa3c2a
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
20 additions
and
11 deletions
+20
-11
1.bmp
sessions/session-3/Image/1.bmp
+0
-0
1.bmp
sessions/session-3/Image/1/1.bmp
+0
-0
2.bmp
sessions/session-3/Image/1/2.bmp
+0
-0
3.bmp
sessions/session-3/Image/1/3.bmp
+0
-0
4.bmp
sessions/session-3/Image/1/4.bmp
+0
-0
5.bmp
sessions/session-3/Image/1/5.bmp
+0
-0
1.bmp
sessions/session-3/Image/2/1.bmp
+0
-0
ubuwidgets.py
sessions/session-3/ubuwidgets.py
+18
-6
window.py
sessions/session-3/window.py
+2
-5
No files found.
sessions/session-3/Image/1.bmp
deleted
100644 → 0
View file @
c4932e82
246 Bytes
sessions/session-3/Image/1/1.bmp
deleted
100644 → 0
View file @
c4932e82
246 Bytes
sessions/session-3/Image/1/2.bmp
deleted
100644 → 0
View file @
c4932e82
246 Bytes
sessions/session-3/Image/1/3.bmp
deleted
100644 → 0
View file @
c4932e82
246 Bytes
sessions/session-3/Image/1/4.bmp
deleted
100644 → 0
View file @
c4932e82
246 Bytes
sessions/session-3/Image/1/5.bmp
deleted
100644 → 0
View file @
c4932e82
246 Bytes
sessions/session-3/Image/2/1.bmp
deleted
100644 → 0
View file @
c4932e82
246 Bytes
sessions/session-3/ubuwidgets.py
View file @
f8ae4ea1
...
@@ -62,15 +62,26 @@ class Board(QWidget):
...
@@ -62,15 +62,26 @@ class Board(QWidget):
cnt
=
0
cnt
=
0
maxf
=
0
maxf
=
0
for
file
in
os
.
listdir
(
label
):
for
file
in
os
.
listdir
(
label
):
if
file
.
endswith
(
'.
bmp
'
):
if
file
.
endswith
(
'.
png
'
):
cnt
+=
1
cnt
+=
1
tmpN
=
int
(
file
[:
-
4
:])
tmpN
=
int
(
file
[:
-
4
:])
maxf
=
max
(
maxf
,
tmpN
)
maxf
=
max
(
maxf
,
tmpN
)
visibleImage
.
save
(
'tmp.
bmp
'
)
visibleImage
.
save
(
'tmp.
png
'
)
pixmap
=
QPixmap
(
'tmp.
bmp'
)
.
scaled
(
8
,
8
)
pixmap
=
QPixmap
(
'tmp.
png'
)
.
scaled
(
16
,
16
)
pixmap
.
save
(
label
+
'/'
+
str
(
max
(
cnt
,
maxf
)
+
1
)
+
'.
bmp
'
)
pixmap
.
save
(
label
+
'/'
+
str
(
max
(
cnt
,
maxf
)
+
1
)
+
'.
png
'
)
QFile
.
remove
(
'tmp.
bmp
'
)
QFile
.
remove
(
'tmp.
png
'
)
def
saveImageTest
(
self
):
import
os
visibleImage
=
self
.
image
self
.
resizeImage
(
visibleImage
,
self
.
size
())
if
QDir
(
'Test'
)
.
exists
()
==
False
:
QDir
()
.
mkdir
(
'Test'
)
visibleImage
.
save
(
'tmp.png'
)
pixmap
=
QPixmap
(
'tmp.png'
)
.
scaled
(
16
,
16
)
pixmap
.
save
(
'Test/temp.png'
)
QFile
.
remove
(
'tmp.png'
)
def
paintEvent
(
self
,
event
):
def
paintEvent
(
self
,
event
):
painter
=
QPainter
(
self
)
painter
=
QPainter
(
self
)
...
@@ -117,4 +128,4 @@ class Board(QWidget):
...
@@ -117,4 +128,4 @@ class Board(QWidget):
newImage
.
fill
(
qRgb
(
255
,
255
,
255
))
newImage
.
fill
(
qRgb
(
255
,
255
,
255
))
painter
=
QPainter
(
newImage
)
painter
=
QPainter
(
newImage
)
painter
.
drawImage
(
QPoint
(
0
,
0
),
image
)
painter
.
drawImage
(
QPoint
(
0
,
0
),
image
)
self
.
image
=
newImage
self
.
image
=
newImage
\ No newline at end of file
sessions/session-3/window.py
View file @
f8ae4ea1
from
PyQt5.QtCore
import
Qt
from
PyQt5.QtCore
import
Qt
from
PyQt5.QtWidgets
import
(
QAction
,
QApplication
,
QWidget
,
QGridLayout
)
from
PyQt5.QtWidgets
import
(
QAction
,
QApplication
,
QWidget
,
QGridLayout
)
#from board import Board
#from clearButton import ClearButton
#from trainWidget import TrainWidget
#from testWidget import TestWidget
from
ubuwidgets
import
(
Button
,
ComboWidget
,
Board
)
from
ubuwidgets
import
(
Button
,
ComboWidget
,
Board
)
class
MainWindow
(
QWidget
):
class
MainWindow
(
QWidget
):
...
@@ -45,4 +41,4 @@ if __name__ == '__main__':
...
@@ -45,4 +41,4 @@ if __name__ == '__main__':
app
=
QApplication
(
sys
.
argv
)
app
=
QApplication
(
sys
.
argv
)
window
=
MainWindow
()
window
=
MainWindow
()
window
.
show
()
window
.
show
()
sys
.
exit
(
app
.
exec_
())
sys
.
exit
(
app
.
exec_
())
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment