Skip to content

Instantly share code, notes, and snippets.

@matthewd673
Created May 16, 2015 17:44
Show Gist options
  • Save matthewd673/4ef53a02d42b37843cf1 to your computer and use it in GitHub Desktop.
Save matthewd673/4ef53a02d42b37843cf1 to your computer and use it in GitHub Desktop.
A simple class to load images from URLs (used for MiniLD #59)
package com.bitbit.minild59.codes.main;
import java.awt.image.BufferedImage;
import java.io.IOException;
import java.net.URL;
import javax.imageio.ImageIO;
public class LoadSprites
{
public static BufferedImage sprites;
public static void DownloadSprites()
{
try
{
URL url = new URL("http://swapshop.pixelsyntax.com/api/randomImage");
sprites = ImageIO.read(url);
}
catch (IOException e)
{
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment