Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Using EMF+ with SWT
Using EMF+ with SWT [message #507369] Wed, 13 January 2010 03:18 Go to next message
Jan Mauersberger is currently offline Jan MauersbergerFriend
Messages: 120
Registered: July 2009
Senior Member
Hello,

I'm trying to find a way to draw draw2d graphics into an EMF+ file. The
background: before I was using the EMF library from FreeHEP to write EMF
files but unfortunately FreeHEP/EMF does not support transparency. I
found out that this is supported by EMF+ which in turn is part of GGI+.
I tried alternatives as the Tritos project which is using a custom
Device implementation that uses handles to native enhanced meta file
structures in conjunction with SWT but again this is only EMF.

My plan was now to write my own Device (or what ever), create a GDI+
Metafile object and somehow "force" (or just ask) SWT to use this in the
drawing context in enhanced Gdip mode.

Unfortunately I'm stuck. It seems that in advanced Gdip mode the SWT is
using the "Gdip.Graphics_new(int /*long*/ hdc)" method to create a
Grphics object which does (in the native code) uses the new
Graphics(HDC) constructor. As far as I can see I have to use the
Graphics(Image) constructor because the Metafile class is extending the
Image class.

Does anyone has an idea how to accomplish that without writing my own
drawing context from scratch?

Thanks a lot in advance
Jan

PS: Any plans to improve the Gdip support in SWT?
Re: Using EMF+ with SWT [message #509715 is a reply to message #507369] Mon, 25 January 2010 07:34 Go to previous message
Jan Mauersberger is currently offline Jan MauersbergerFriend
Messages: 120
Registered: July 2009
Senior Member
Just to answer myself and to renew this question :-)

If I wrap the native Metafile with a native Graphics object and pass
this to the SWT GC, again the result is only EMF (not EMF+). The only
solution I partially accomplished was to write my own SWT Graphics
object that uses the native GDIP Graphics object and more or less does
the same things as the SWT GC but that' a lot of copy & paste from the
GC class ;-(

The simplest way would be to allow passing an own native GDIP Graphics
object to the GC but the current SWT implementation doe snot support
this. Any chance to get that supported in the future?

Jan

> Hello,
>
> I'm trying to find a way to draw draw2d graphics into an EMF+ file. The
> background: before I was using the EMF library from FreeHEP to write EMF
> files but unfortunately FreeHEP/EMF does not support transparency. I
> found out that this is supported by EMF+ which in turn is part of GGI+.
> I tried alternatives as the Tritos project which is using a custom
> Device implementation that uses handles to native enhanced meta file
> structures in conjunction with SWT but again this is only EMF.
>
> My plan was now to write my own Device (or what ever), create a GDI+
> Metafile object and somehow "force" (or just ask) SWT to use this in the
> drawing context in enhanced Gdip mode.
>
> Unfortunately I'm stuck. It seems that in advanced Gdip mode the SWT is
> using the "Gdip.Graphics_new(int /*long*/ hdc)" method to create a
> Grphics object which does (in the native code) uses the new
> Graphics(HDC) constructor. As far as I can see I have to use the
> Graphics(Image) constructor because the Metafile class is extending the
> Image class.
>
> Does anyone has an idea how to accomplish that without writing my own
> drawing context from scratch?
>
> Thanks a lot in advance
> Jan
>
> PS: Any plans to improve the Gdip support in SWT?
Previous Topic:Best way to embed Links in Text
Next Topic:Table: Removing not only items, but also all colums
Goto Forum:
  


Current Time: Thu Apr 25 08:35:15 GMT 2024

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

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

Back to the top