package net.pterodactylus.util.image;
+import java.awt.Image;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
return null;
}
+ /**
+ * Loads an image from the class path.
+ *
+ * @param resourceName
+ * The name of the image
+ * @return The image, or <code>null</code> if no image was found
+ */
+ public static Image loadImage(String resourceName) {
+ ImageIcon imageIcon = (ImageIcon) loadIcon(resourceName);
+ if (imageIcon == null) {
+ return null;
+ }
+ return imageIcon.getImage();
+ }
+
}