23 package com.realtime.crossfire.jxclient.skin.io;
28 import java.awt.Color;
29 import java.awt.Image;
30 import java.awt.image.BufferedImage;
31 import java.io.IOException;
32 import java.io.InputStream;
33 import javax.imageio.ImageIO;
34 import org.jetbrains.annotations.NotNull;
35 import org.jetbrains.annotations.Nullable;
79 public Image
getImage(@Nullable
final Color color, @NotNull
final String name)
throws IOException {
81 return color ==
null ?
getImage(name) :
null;
91 public BufferedImage
getImage(@NotNull
final String name)
throws IOException {
98 final String filename =
"pictures/"+name+
".png";
99 final BufferedImage image;
101 image = ImageIO.read(inputStream);
104 throw new IOException(
"image '"+
skinSource.
getURI(filename)+
"' does not exist");
109 throw new AssertionError(ex);