Hello Community,
I want to load an image from the ressource with this code:
-----------------------------------------------------------------------
private void loadPreview(String Path)
{
try
{
InputStream is = this.getClass().getResourceAsStream("/level/levelPrev1.jpg");
if (is == null)
{
throw new IOException();
}
BufferedImage temp = ImageIO.read(is);
world_image = new GreenfootImage(64,64);
BufferedImage wi_awt = world_image.getAwtImage();
wi_awt = temp;
myGame.setImage(world_image); // nur anzeigen
}
catch (IOException e)
{
myGame.showMessage("Error while parsing Map - Couldn't find image \""+Path+"\"", "Error while parsing");
}
}
-----------------------------------------------------------------------
but unfortunately the resulting GreenfootImage is just fully transparent
Hoping someone can help me ... Mike
PS: Sorry for my bad English - Currently i'm learning this language :-D