com.jtransc.imaging.async.impl.JTranscAsyncBitmapDataDecoderHtml Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jtransc-rt-core Show documentation
Show all versions of jtransc-rt-core Show documentation
JVM AOT compiler currently generating JavaScript, C++, Haxe, with initial focus on Kotlin and games.
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