FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
matplotlib/lib/matplotlib/backends/tkagg.py at v1.5.3 · matplotlib/matplotlib · GitHub
matplotlib
matplotlib
Repository navigation
Code
Issues
1.1k
(1.1k)
Pull requests
432
(432)
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
matplotlib
/
lib
/
matplotlib
/
backends
/
tkagg.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
43 lines (37 loc) · 1.27 KB
Breadcrumbs
matplotlib
/
lib
/
matplotlib
/
backends
/
tkagg.py
Copy path
File metadata and controls
43 lines (37 loc) · 1.27 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
40
41
42
43
from
__future__
import
(
absolute_import
,
division
,
print_function
,
unicode_literals
)
from
matplotlib
.
externals
import
six
from
matplotlib
.
externals
.
six
.
moves
import
tkinter
as
Tk
import
numpy
as
np
from
matplotlib
.
backends
import
_tkagg
def
blit
(
photoimage
,
aggimage
,
bbox
=
None
,
colormode
=
1
):
tk
=
photoimage
.
tk
if
bbox
is
not
None
:
bbox_array
=
bbox
.
__array__
()
else
:
bbox_array
=
None
data
=
np
.
asarray
(
aggimage
)
try
:
tk
.
call
(
"PyAggImagePhoto"
,
photoimage
,
id
(
data
),
colormode
,
id
(
bbox_array
))
except
Tk
.
TclError
:
try
:
try
:
_tkagg
.
tkinit
(
tk
.
interpaddr
(),
1
)
except
AttributeError
:
_tkagg
.
tkinit
(
id
(
tk
),
0
)
tk
.
call
(
"PyAggImagePhoto"
,
photoimage
,
id
(
data
),
colormode
,
id
(
bbox_array
))
except
(
ImportError
,
AttributeError
,
Tk
.
TclError
):
raise
def
test
(
aggimage
):
import
time
r
=
Tk
.
Tk
()
c
=
Tk
.
Canvas
(
r
,
width
=
aggimage
.
width
,
height
=
aggimage
.
height
)
c
.
pack
()
p
=
Tk
.
PhotoImage
(
width
=
aggimage
.
width
,
height
=
aggimage
.
height
)
blit
(
p
,
aggimage
)
c
.
create_image
(
aggimage
.
width
,
aggimage
.
height
,
image
=
p
)
blit
(
p
,
aggimage
)
while
1
:
r
.
update_idletasks
()
Back
|
FazBrowse Home
|
New Git URL