문제

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top