tags:

views:

27

answers:

1

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!

A: 

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.

zvikico
That's nice.Thank you for your links.:)
I'm glad you found it helpful. Welcome to StackOverflow. If you like the answer, use the up arrow to mark that you like it. If you found that it solved your problem, use the V sign to mark it as the correct answer.
zvikico