Writing to offscreen SWT image? [message #448023] |
Sun, 26 December 2004 08:20 |
Eclipse User |
|
|
|
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 |
Eclipse User |
|
|
|
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
|
|
|
Powered by
FUDForum. Page generated in 0.02542 seconds