Skip to main content



      Home
Home » Eclipse Projects » GEF » Printing Draw2d IFigure
Printing Draw2d IFigure [message #169718] Fri, 25 February 2005 11:23 Go to next message
Eclipse UserFriend
Originally posted by: steffen64{removethis}.hotmail.com

Hi,
I am looking for some ready made code for printing a Draw2d Ifigure to
an image file. I've been digging through the posts but haven't found
anything very helpful. Just small snippets that didn't help. Have also
tried the gef.logic example from CVS, but couldn't get that working either.
Does anyone have some suggestions where to look? Or have an example
themselves they would like to share?
Any help would be appreciated.

/Steffen
Re: Printing Draw2d IFigure [message #169829 is a reply to message #169718] Sun, 27 February 2005 17:03 Go to previous message
Eclipse UserFriend
Something like this:

Dimension imageSize = fig.getPreferredSize(-1, -1);
fig.setSize(imageSize);
Image img = new Image(null, imageSize.width, imageSize.height);
GC gc = new GC(img);
Graphics graphics = new SWTGraphics(gc);
fig.paint(graphics);
graphics.dispose();
gc.dispose();


"Steffen Andersen" <steffen64{removethis}@hotmail.com> wrote in message
news:cvnjd8$5mt$1@www.eclipse.org...
> Hi,
> I am looking for some ready made code for printing a Draw2d Ifigure to
> an image file. I've been digging through the posts but haven't found
> anything very helpful. Just small snippets that didn't help. Have also
> tried the gef.logic example from CVS, but couldn't get that working
either.
> Does anyone have some suggestions where to look? Or have an example
> themselves they would like to share?
> Any help would be appreciated.
>
> /Steffen
Previous Topic:draw2d.text question
Next Topic:Diagram in GEF editor
Goto Forum:
  


Current Time: Tue Jun 24 22:45:51 EDT 2025

Powered by FUDForum. Page generated in 0.06102 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top