How to export some controls of SWT to SVG pic?
-
01-10-2019 - |
문제
If I have a TreeViewer or Table,or I have some buttons,labels which contain different text,pic and so on. Now,I want to export these to a SVG pic.
Does anyone know about this?
Many Thanks!
해결책
I don't know about SVG, but the org.eclipse.swt.graphics.ImageLoader
can be used to save a org.eclipse.swt.graphics.GC
in various formats like PNG, GIF, JPEG and BMP. You can convert the result to SVG if you'd like.
You can find examples of how to save a GC to a file (like this one). You can also copy an existing GC using the copyArea
method. Take a look at this source code. Look for the usage of gc.copyArea method and you'll find a example of how to take such a snapshot.
제휴하지 않습니다 StackOverflow