Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » print to image
print to image [message #49043] Thu, 12 December 2002 10:06 Go to next message
Christof Binder is currently offline Christof BinderFriend
Messages: 13
Registered: July 2009
Junior Member
Hello,
I want to print my contents. At first I painted it directly to the
printer object with the discussed problems of getting tiny pictures.
Then I read the posting where one gave the tip of printing the contents
to an image, scale it and then send it to the printer. Here is what I tried:
....
Image tmpImage = new Image(null, 800, 600);
GC tmpGC = new GC(tmpImage);
SWTGraphics tmpGraphics = new SWTGraphics(tmpGC);
((GraphicalEditPart) getGraphicalViewer().getRootEditPart().getRoot())
.getFigure().paint(tmpGraphics);
// tmpImage has no ImageData (is still empty array),
// so the rest has no effect
ImageData tmpIData = tmpImage.getImageData().scaledTo(200, 400);
tmpImage = new Image(null, tmpIData);
tmpGC = new GC(tmpImage);
tmpGraphics = new SWTGraphics(tmpGC);
....

Does someone see an error here? How to print to an Image?

Thanks,

Chris
Re: print to image [message #49173 is a reply to message #49043] Thu, 12 December 2002 18:06 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: hudsonr.us.eye-bee-em.com

We almost done with a PrintOperation, PrinterGraphics, and ScaledGraphics
class.
I would recommend waiting a few more days for this method of printing.

"Chris" <wibni@web.de> wrote in message news:3DF85F97.5070301@web.de...
> Hello,
> I want to print my contents. At first I painted it directly to the
> printer object with the discussed problems of getting tiny pictures.
> Then I read the posting where one gave the tip of printing the contents
> to an image, scale it and then send it to the printer. Here is what I
tried:
> ...
> Image tmpImage = new Image(null, 800, 600);
> GC tmpGC = new GC(tmpImage);
> SWTGraphics tmpGraphics = new SWTGraphics(tmpGC);
> ((GraphicalEditPart) getGraphicalViewer().getRootEditPart().getRoot())
> .getFigure().paint(tmpGraphics);
> // tmpImage has no ImageData (is still empty array),
> // so the rest has no effect
> ImageData tmpIData = tmpImage.getImageData().scaledTo(200, 400);
> tmpImage = new Image(null, tmpIData);
> tmpGC = new GC(tmpImage);
> tmpGraphics = new SWTGraphics(tmpGC);
> ...
>
> Does someone see an error here? How to print to an Image?
>
> Thanks,
>
> Chris
>
Re: print to image [message #49327 is a reply to message #49173] Thu, 12 December 2002 22:45 Go to previous message
Dieter Moroff is currently offline Dieter MoroffFriend
Messages: 24
Registered: July 2009
Junior Member
Hi Randy,

that are great news! Is an export to the windows clipboard (in WMF-Format)
also in the pipe?

Dieter

"Randy Hudson" <hudsonr@us.eye-bee-em.com> schrieb im Newsbeitrag
news:ataj0m$mga$1@rogue.oti.com...
> We almost done with a PrintOperation, PrinterGraphics, and ScaledGraphics
> class.
> I would recommend waiting a few more days for this method of printing.
>
> "Chris" <wibni@web.de> wrote in message news:3DF85F97.5070301@web.de...
> > Hello,
> > I want to print my contents. At first I painted it directly to the
> > printer object with the discussed problems of getting tiny pictures.
> > Then I read the posting where one gave the tip of printing the contents
> > to an image, scale it and then send it to the printer. Here is what I
> tried:
> > ...
> > Image tmpImage = new Image(null, 800, 600);
> > GC tmpGC = new GC(tmpImage);
> > SWTGraphics tmpGraphics = new SWTGraphics(tmpGC);
> > ((GraphicalEditPart) getGraphicalViewer().getRootEditPart().getRoot())
> > .getFigure().paint(tmpGraphics);
> > // tmpImage has no ImageData (is still empty array),
> > // so the rest has no effect
> > ImageData tmpIData = tmpImage.getImageData().scaledTo(200, 400);
> > tmpImage = new Image(null, tmpIData);
> > tmpGC = new GC(tmpImage);
> > tmpGraphics = new SWTGraphics(tmpGC);
> > ...
> >
> > Does someone see an error here? How to print to an Image?
> >
> > Thanks,
> >
> > Chris
> >
>
>
Previous Topic:GraphicalRootEditPartWithOverview and Dock classes missing
Next Topic:documentation?
Goto Forum:
  


Current Time: Fri Jan 03 08:26:24 GMT 2025

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

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

Back to the top