Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[gef-dev] How to save draw2d elements in a file?

Hi all,

I'm a new user of GEF libraries, and I've got a problem.

My eclipse plugin allow me to drag'n'drop gef elements in an editor. It works fine.
Now I would like to save my editor in a JPEG file for example.
But I'm not able to get the graphicals elements.
I always get a blank jpeg file.
Here is my code :

Image img =
            new Image(editor.getViewer().getControl().getDisplay(),
                    2000, 2000);
      
        ImageLoader loader = new ImageLoader();
        loader.data = "" ImageData[]{img.getImageData()};
        loader.save("/home/me/Desktop/toto.jpeg", SWT.IMAGE_JPEG);

Can you help me please? Do you see where could be my error(s)?

Thanks in advance,
Nicolas

Back to the top