[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
[tools-dev] Transformable GC
|
Hi there
I had the need to do some more enhanced graphics context magic than
just drawing horizontal text, so I went ahead and created a GC that
is transformable: rotate, scale, translate. Hence, I dubbed it
"Transformable GC".
In my opinion this would make a reasonable enhancement for SWT in
general. The question of how to draw a rotated text with SWT pops up
quite a few times on the newsgroups...
So far I have a working package for carbon and win32. On the win32
platform I use GDI+ which comes by default with WinXP. Luckily, there
is a redristributable DLL available from MS for older Windows versions.
You can d/l screenshots of the test application and of a more
complicated example here: http://www.abstrakt.ch/tgc/
The reason I went for GDI+ is simple: I wanted anti-aliasing.
In conjunction with the Java API AffineTransform, it should be fairly
straightforward to create a version that only uses SWT calls, at least
on Windows (one can get a rotated Font by using LOGFONT.lfEscapement).
Now for this package to really make sense it should go either directly
into SWT, or it should be distributed as a separate project à la GEF. A
separate project would probably make more sense at the time being, as
I haven't ported it to any other platform than carbon and win32.
If there's a chance -- what would be the process of getting something
like this accepted as a separate plugin (like GEF)? Obviously I'm
willing to donate the code and spend more time on this.
Regards
-andreas
--
beta test, v:
To voluntarily entrust one's data, one's livelihood and one's
sanity to hardware or software intended to destroy all three.
In earlier days, virgins were often selected to beta test volcanos.