Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Writing to offscreen SWT image?
Writing to offscreen SWT image? [message #448023] Sun, 26 December 2004 08:20 Go to next message
Eclipse UserFriend
Originally posted by: rohroh_us.yahoo.com

Is there any way I can create an 'offscreen' SWT image, obtain a GC for
this image and write primitives (lines, rectangles, text, etc) to it? I
need to perform offscreen text rotation and I'm hoping to use this
offscreen image with text written to it. Or is there an easier way to
rotate text to any arbitrary angle in SWT?

I need to process the ImageData.data byte[] using my custom rotation
filter but I don't need to display the original image that I am hoping to
create using GC primitives in an offscreen image.

So even if I do a...

Display d = new Display();
GC gc = new GC(d);
gc.drawText...
gc.drawLine...
gc.drawRectangle...

This GC should've been associated with a new Display that I created which
is not really associated with any Composite (you would think). However,
any primtives that I render seem to be written to my desktop/eclipse IDE's
client area.

Any suggestions?

TIA
Re: Writing to offscreen SWT image? [message #448024 is a reply to message #448023] Sun, 26 December 2004 08:40 Go to previous message
Eclipse UserFriend
Originally posted by: rohroh_us.yahoo.com

Found the solution at:

http://www.eclipse.org/articles/Article-SWT-graphics/SWT_gra phics.html

Didn't realize I could create a GC using a GC(Image) constructor
and write directly to that GC.

---

Brian McKnight wrote:


> Is there any way I can create an 'offscreen' SWT image, obtain a GC for
> this image and write primitives (lines, rectangles, text, etc) to it? I
> need to perform offscreen text rotation and I'm hoping to use this
> offscreen image with text written to it. Or is there an easier way to
> rotate text to any arbitrary angle in SWT?

> I need to process the ImageData.data byte[] using my custom rotation
> filter but I don't need to display the original image that I am hoping to
> create using GC primitives in an offscreen image.

> So even if I do a...

> Display d = new Display();
> GC gc = new GC(d);
> gc.drawText...
> gc.drawLine...
> gc.drawRectangle...

> This GC should've been associated with a new Display that I created which
> is not really associated with any Composite (you would think). However,
> any primtives that I render seem to be written to my desktop/eclipse IDE's
> client area.

> Any suggestions?

> TIA
Previous Topic:newbie , pls help , thanks
Next Topic:RCP newbie. Can I build a j2ee rich client out of the box?
Goto Forum:
  


Current Time: Thu Apr 25 20:44:20 GMT 2024

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

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

Back to the top