Label aligned along a connection [message #163373] |
Sun, 09 January 2005 10:30  |
Eclipse User |
|
|
|
Originally posted by: ilja.selenzow.web.de
Hi,
is it possible to align a label along a connection so it will stay aligned
in this way even when connection is drawed in the vertical direction?
Thanks in advance.
Ilja
|
|
|
|
|
|
|
|
|
|
Re: Label aligned along a connection [message #164220 is a reply to message #164190] |
Mon, 17 January 2005 18:33  |
Eclipse User |
|
|
|
Ilja,
You can use the following snippet to get bitmap data for rotation.
label would be the Draw2D label figure you wish to rotate, width and
height correspond to the label width and height.
Image = new Image(display, width, height);
GC gc = new GC(image);
SWTGraphics graphics = new SWTGraphics(gc);
label.paint(graphics);
graphics.dispose();
gc.dispose();
image.getImageData() will return an ImageData object whose data field
would be the bitmap data. This data will vary according to your screen
depth - you could get an 8(not sure), 16, 24 or 32 bit bitmap.
Hope this helps,
Brian.
Ilja Selenzow wrote:
> Thank you Randy very much for your fast answer,
> but the algorithm to perform an affine transformation of a piction isn't my
> difficulty, I think...a little bit of coordinates manipulation and
> interpolation ;)
> But there are two another problems I have to deal with:
> 1. How can I get an image (preffered a bitmap) of my text that I can rotate
> then?
> 2. How can I place the rotated image on my connection so it won't cover the
> figure connection starts at?
> ______ ________
> | |
> Label____________ but: |_Label__________
> ______| ________|
> Thanks in advance and I'm sorry, when I'm asking stupid questions.
> Ilja
|
|
|
Powered by
FUDForum. Page generated in 0.04935 seconds