Python Forum
ezdxf - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: GUI (https://python-forum.io/forum-10.html)
+--- Thread: ezdxf (/thread-31350.html)



ezdxf - Mati_1 - Dec-06-2020

Hi,
How can I create window (using tkinter) with .dxf file inside this window?

Something like:
" import ezdxf
from tkinter import *

aaa = "E:\dxf_test\dxf_test\dxf_test1.dxf"
doc = ezdxf.readfile(aaa)

window = Tk()
my_img1 = PhotoImage(file=doc)
my_label = Label(window, image=my_img1).pack()"

Is it possible to open directly .dxf image in tkinter's window or I must convert it to .png/.jpg or how can I do this?


RE: ezdxf - joe_momma - Dec-06-2020

first convert to png file using drawing using drawing to convert dxf to png
then make a label using pil or pillow here's an example: label with image using PIL