I have a RAP Application running in OSGI. And I want to display some images.
Unfortunately my browser won´t show the image for the file I want. I tested it with an very small gif, which showed. But just one. When I exchanged it with an other it still won´t work. The exact problem is, that, if I place a border around the pictures, i can see the border. But there is nothing in the border.
I have tried a number of different things for days now but I think I´m stuck at this point.
I tried doing it like this:
Image image3 = loadImage( parent.getDisplay(), "icons/test-100x50.png" );
Label l3 = new Label( parent, SWT.BORDER );
l3.setImage( image3 );
and like this:
public static Image loadImage( Display display, String name ) {
Image result = null;
InputStream stream = BasicEntryPoint.class.getClassLoader().getResourceAsStream( name );
if( stream != null ) {
try {
result = new Image( display, stream );
} finally {
try {
stream.close();
} catch( IOException unexpected ) {
throw new RuntimeException( "Failed to close image input stream", unexpected );
}
}
}
return result;
}
I even tried it with MarkUps
but i can´t find what i´m missing.
the images are in the plug-in in a folder called icons
and i have selected the icons
folder in the build.properties
file.
FYI: I saw the RAP Demo with the Blue Header and Implemented my picture like this. At first it worked, but as soon as I started it as a OSGI App I could only see the border for the command SWT.BORDER