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

com.jtransc.imaging.async.impl.JTranscAsyncBitmapDataDecoderHtml Maven / Gradle / Ivy

Go to download

JVM AOT compiler currently generating JavaScript, C++, Haxe, with initial focus on Kotlin and games.

There is a newer version: 0.6.8
Show newest version
package com.jtransc.imaging.async.impl;

import com.jtransc.async.JTranscAsyncHandler;
import com.jtransc.imaging.JTranscNativeBitmap;
import com.jtransc.imaging.async.JTranscAsyncBitmapDataDecoder;
import com.jtransc.target.js.JsDynamic;

public class JTranscAsyncBitmapDataDecoderHtml extends JTranscAsyncBitmapDataDecoder {
	private void _readFromURLAsyncImpl(final String path, final JTranscAsyncHandler handler) {
		JsDynamic image = JsDynamic.global("Image").newInstance(path);
		image.call("addEventListener", "load", JsDynamic.func(new JsDynamic.Function1() {
			@Override
			public Object run(JsDynamic e) {
				return null;
			}
		}));
	}

	@Override
	public void readFromURLAsyncImpl(String url, JTranscAsyncHandler handler) {
		_readFromURLAsyncImpl(url, handler);
	}

	@Override
	public void readFromFileAsyncImpl(String file, JTranscAsyncHandler handler) {
		_readFromURLAsyncImpl(file, handler);
	}

	@Override
	public void readFromBytesAsyncImpl(byte[] data, JTranscAsyncHandler handler) {
		throw new RuntimeException("Not implemented");
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy