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
feaa3c2a
Commit
feaa3c2a
authored
7 years ago
by
Kriengsak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add save image for test
parent
8d90621e
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 @
8d90621e
246 Bytes
This diff is collapsed.
Click to expand it.
sessions/session-3/Image/1/1.bmp
deleted
100644 → 0
View file @
8d90621e
246 Bytes
This diff is collapsed.
Click to expand it.
sessions/session-3/Image/1/2.bmp
deleted
100644 → 0
View file @
8d90621e
246 Bytes
This diff is collapsed.
Click to expand it.
sessions/session-3/Image/1/3.bmp
deleted
100644 → 0
View file @
8d90621e
246 Bytes
This diff is collapsed.
Click to expand it.
sessions/session-3/Image/1/4.bmp
deleted
100644 → 0
View file @
8d90621e
246 Bytes
This diff is collapsed.
Click to expand it.
sessions/session-3/Image/1/5.bmp
deleted
100644 → 0
View file @
8d90621e
246 Bytes
This diff is collapsed.
Click to expand it.
sessions/session-3/Image/2/1.bmp
deleted
100644 → 0
View file @
8d90621e
246 Bytes
This diff is collapsed.
Click to expand it.
sessions/session-3/ubuwidgets.py
View file @
feaa3c2a
...
...
@@ -62,15 +62,26 @@ class Board(QWidget):
cnt
=
0
maxf
=
0
for
file
in
os
.
listdir
(
label
):
if
file
.
endswith
(
'.
bmp
'
):
if
file
.
endswith
(
'.
png
'
):
cnt
+=
1
tmpN
=
int
(
file
[:
-
4
:])
maxf
=
max
(
maxf
,
tmpN
)
visibleImage
.
save
(
'tmp.
bmp
'
)
pixmap
=
QPixmap
(
'tmp.
bmp'
)
.
scaled
(
8
,
8
)
pixmap
.
save
(
label
+
'/'
+
str
(
max
(
cnt
,
maxf
)
+
1
)
+
'.
bmp
'
)
QFile
.
remove
(
'tmp.
bmp
'
)
visibleImage
.
save
(
'tmp.
png
'
)
pixmap
=
QPixmap
(
'tmp.
png'
)
.
scaled
(
16
,
16
)
pixmap
.
save
(
label
+
'/'
+
str
(
max
(
cnt
,
maxf
)
+
1
)
+
'.
png
'
)
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
):
painter
=
QPainter
(
self
)
...
...
@@ -117,4 +128,4 @@ class Board(QWidget):
newImage
.
fill
(
qRgb
(
255
,
255
,
255
))
painter
=
QPainter
(
newImage
)
painter
.
drawImage
(
QPoint
(
0
,
0
),
image
)
self
.
image
=
newImage
self
.
image
=
newImage
\ No newline at end of file
This diff is collapsed.
Click to expand it.
sessions/session-3/window.py
View file @
feaa3c2a
from
PyQt5.QtCore
import
Qt
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
)
class
MainWindow
(
QWidget
):
...
...
@@ -45,4 +41,4 @@ if __name__ == '__main__':
app
=
QApplication
(
sys
.
argv
)
window
=
MainWindow
()
window
.
show
()
sys
.
exit
(
app
.
exec_
())
sys
.
exit
(
app
.
exec_
())
\ No newline at end of file
This diff is collapsed.
Click to expand it.
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