且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

保存图像在一个小程序文件?

更新时间:2023-11-26 12:25:46

不需要使用部署一个applet数码code签约插件2(PI2 - 1.6.0_10 +)架构JRE。在PI2 JRE,嵌入式小程序可以访问所有的服务通常只提供给Java Web Start的应用程序。

Digital code signing is not required for an applet deployed using a Plug-In 2 (PI2 - 1.6.0_10+) architecture JRE. In a PI2 JRE, an embedded applet can access all the services normally only available to Java Web Start apps.

感兴趣此applet的服务将是 FileOpenService ( FOS)和 PersistenceService (PS)。果寡糖可以用于允许用户导航到一个文件(或更确切地说 - 一个FileContents)从它的对象,将获得的流。一旦用户满意裁切的图像,在保存到PS为以后的检索(使用ImageIO的,前面已经提到)。

The services of interest to this applet would be the FileOpenService (FOS), and the PersistenceService (PS). The FOS could be used to allow the user to navigate to a File (or rather - a FileContents) object and obtain streams from it. Once the user is happy with the cropped image, save in to the PS for later retrieval (using ImageIO, as already mentioned).