All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.stathissideris.ascii2image.graphics.ImageHandler Maven / Gradle / Ivy

There is a newer version: 1.2024.8
Show newest version
// THIS FILE HAS BEEN GENERATED BY A PREPROCESSOR.
package org.stathissideris.ascii2image.graphics;

import java.awt.Image;

public class ImageHandler {

//	private static OffScreenSVGRenderer svgRenderer = 
//		new OffScreenSVGRenderer();

	private static ImageHandler instance = new ImageHandler();

	public static ImageHandler instance() {
		return instance;
	}

//	private static final MediaTracker tracker = new MediaTracker(new JLabel());

	public Image loadImage(String filename) {
		return null;
//		URL url = ClassLoader.getSystemResource(filename);
//		Image result = null;
//		if(url != null)
//			result = Toolkit.getDefaultToolkit().getImage(url);
//		else
//			result = Toolkit.getDefaultToolkit().getImage(filename);
////			result = null;
//
//		//wait for the image to load before returning
//		tracker.addImage(result, 0);
//		try {
//			tracker.waitForID(0);
//		} catch (InterruptedException e) {
//			System.err.println("Failed to load image "+filename);
//			Logme.error(e);
//		}
//		tracker.removeImage(result, 0);
//		
//		return result;
	}

//	public BufferedImage renderSVG(String filename, int width, int height, boolean stretch) throws IOException {
//		File file = SecurityUtils.File(filename);
//		URI uri = file.toURI();
//		return svgRenderer.renderToImage(uri.toString(), width, height, stretch, null, null);
//	}
//
//	public BufferedImage renderSVG(String filename, int width, int height, boolean stretch, String idRegex, Color color) throws IOException {
//		File file = SecurityUtils.File(filename);
//		URI uri = file.toURI();
//		return svgRenderer.renderToImage(uri.toString(), width, height, stretch, idRegex, color);
//	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy