有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

java为什么要使用JNI在AWT的画布上画画?

我对JNI还很陌生,在研究JNI时,我偶然发现了这一点:

Not only can native code interface with Java, it can also draw on a Java Canvas, which is possible with the Java AWT Native Interface

这项功能之所以特别/可用,有什么具体原因吗?它是否提高了Windows系统的处理时间?请详细说明为什么以及何时使用这种功能


共 (1) 个答案

  1. # 1 楼答案

    Java中的本机性能渲染。。。首先想到的是游戏,但真正画出任何需要大量计算或需要高帧率的东西都会有好处

    Official Java Explanation

    The ability to draw directly into a Java Canvas from a native code library is extremely useful for developers planning to migrate a legacy software system to Java, especially one that includes a high-performance rendering engine. It makes it much easier to migrate in stages, leaving performance-sensitive rendering code alone, while other less-sensitive portions of code are converted to Java. The result can be a modern Java-centric application, providing the benefit of portability and development efficiency, but one that does not sacrifice an investment in performance of a key piece of native code.