Generate vector EMF/WMF (Windows Metafile) clipboard content from Qt 4.5

China☆狼群 提交于 2019-12-24 12:20:03

问题


We are moving a large codebase from GDI to QPainter. One thing we used to get on Windows easily was the EMF clipboard format, which enabled customers to manipulate their pasted output in other programs (like Office) in a vector format.

It's easy for us to produce bitmaps from Qt into EMF, but that really doesn't give us back the editability of the old format. We can also make mime data from Postscript, which in some programs will retain vector format, but won't allow editability in Office, for example.

Since Trolltech/Nokia abandoned the GDI rendering path, is there any decent way to produce vector EMF output from QPainter? Options include 3rd-party libraries postprocessing other output formats (which we haven't seen usable results from), phony printer drivers (which introduce Windows-version specific issues). It has to work on WinXP -> 7.

Has anybody else solved this?


回答1:


Well, now I see that this has been asked and answered here before. The accepted answer there is that it can't be done easily. If anyone has any better news, I'd be happy to hear it.




回答2:


I have a PyQt QPaintEngine for rendering to EMF here (GPL): http://svn.gna.org/viewcvs/veusz/trunk/document/emf_export.py?view=markup

It also uses the PyEMF library. It would be hard to convert this to C++ if necessary.




回答3:


I just came across this possible solution: EmfEngine. I haven't used it, so YMMV.



来源:https://stackoverflow.com/questions/2013445/generate-vector-emf-wmf-windows-metafile-clipboard-content-from-qt-4-5

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!