【发布时间】:2013-04-06 19:50:16
【问题描述】:
我创建了一个 JFrame,它为这样的游戏加载外部小程序:
//Setup everything for the Stub.. Below adds the stub to the applet and creates it.
DownloadFile(new URL(World + "/" + Archive), "./gamepack.jar");
CAppletStub Stub = new CAppletStub(new URL(World), new URL(World), this.Parameters);
applet = (Applet) new URLClassLoader(new URL[] {new URL(World.toString() + "/" + Archive)}).loadClass("Rs2Applet").newInstance();
applet.setStub(Stub);
applet.init();
applet.start();
applet.setPreferredSize(new Dimension(Width, Height));
Frame.getContentPane().add(applet);
我正在尝试截取此小程序或让它在 BufferedImage 中绘制其表面。我尝试将“Applet”子类化并将我的 URLClassLoader 转换为该类,但它无法转换,这是有道理的。
如何将小程序渲染到图像中的所有内容捕获?
【问题讨论】:
-
如需尽快获得更好的帮助,请发帖SSCCE。
标签: java image applet awt bufferedimage