How to workaround SWTResourceManager.getImage
Jacob Carlborg
doob at me.com
Sun Oct 6 01:52:39 PDT 2013
On 2013-10-06 08:35, samhu wrote:
> Greetings!
>
> I am trying to compile below dummyeclipse project ,but first
> encountered the subjected issue.I knew to form a Image object one
> can use:
> [code]
> Image image=new Image(display,imgfilename);//e.g. smile.jpg
> [/code]
> But I don't know how to load from a resource file(*.res) to form
> a image as used in DWT java:
> [code]
> (new Label).setImage(SWTResourceManager.getImage("PROP_PS",
> GIFFILE));
> [/code]
I really don't see the difference between "SWTResourceManager.getImage"
and "new Image". The only thing that SWTResourceManager does in addition
is cache the image.
SWTResourceManager is not part of standard SWT, it a part of WindowBuilder.
You can also port it do D :
http://dev.eclipse.org/svnroot/tools/org.eclipse.windowbuilder/trunk/org.eclipse.wb.rcp/resources/1.5/org/eclipse/wb/swt/SWTResourceManager.java
--
/Jacob Carlborg
More information about the Digitalmars-d-dwt
mailing list