Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [platform-swt-dev] Images


Are you able to boil all this down into a snippet that shows the "images don't render the same way shapes do" and "image instantiating performance" problems?
If so, then please open a bug against SWT: https://bugs.eclipse.org/bugs/enter_bug.cgi?product=Platform&component=SWT

Not sure if any of the Image or ImageData snippets are a useful starting point: http://www.eclipse.org/swt/snippets/#image
Also not sure if the GraphicsExample has anything useful in it: http://www.eclipse.org/swt/examples.php

Thanks!
Carolyn


From: Ed Kohlwey <ekohlwey@xxxxxxxxx>
To: platform-swt-dev@xxxxxxxxxxx
Date: 07/29/2009 12:46 PM
Subject: [platform-swt-dev] Images
Sent by: platform-swt-dev-bounces@xxxxxxxxxxx





Hi,
I have what I would think is a usual enough problem that I was hoping someone could help me out with it.

I'm porting a UI component from AWT/Swing to SWT . It is a canvas that has selectable objects. The object's selection must match exactly what is rendered on the canvas. To do this in AWT/Swing, we created a custom composite function and rendered the alpha channel of everything as a unique color to a background buffer. Selection is accomplished by simply seeing what unique color the mouse was over, and then retrieving the associated object from a map.

This doesn't seem to be readily doable in SWT. You can create a wrapper for a GC, make it ignore changes to color, and instead use a picking color when drawing objects. You run into problems, however, when you start rendering images because the images don't render the same way shapes do. I've tried a number of approaches, all of which are unsatisfactory because of the expense in instantiating Image objects. Does anyone have an idea of how/if someone has done this in SWT? It seems like there might be an inherent limitation in the platform that would be worth taking a look at from a design perspective...
_______________________________________________
platform-swt-dev mailing list
platform-swt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/platform-swt-dev



Back to the top