您的位置 首页 java

java9新特性-14-多分辨率图像 API

1.官方Feature

251: Multi-Resolution Images

263: HiDPI Graphics on

Windows and Linux


2.产生背景

在Mac上,JDK已经支持视网膜显示,但在Linux和Windows上,它并没有。在那里, java 程序在当前的高分辨率屏幕上可能看起来很小,不能使用它们。这是因为像素用于这些系统的大小计算(无论像素实际有多大)。毕竟,高分辨率显示器的有效部分是像素非常小。

JEP 263以这样的方式扩展了JDK,即Windows和Linux也考虑到像素的大小。为此,使用比现在更多的现代API:Direct2D for

Windows和GTK +,而不是Xlib for Linux。图形,窗口和文本由此自动缩放。

JEP 251还提供处理多分辨率图像的能力,即包含不同分辨率的相同图像的文件。根据相应屏幕的 DPI 度量,然后以适当的分辨率使用图像。


3.使用说明

新的API定义在java. awt .image包下

将不同分辨率的图像封装到一张(多分辨率的)图像中,作为它的变体

获取这个图像的所有变体

获取特定分辨率的图像变体-表示一张已知分辨率单位为DPI的特定尺寸大小的逻辑图像,并且这张图像是最佳的变体。

基于当前屏幕分辨率大小和运用的图像转换 算法 ,java.awt. Graphics 类可以从接口MultiResolutionImage获取所需的变体。

MultiResolutionImage的基础实现是java.awt.image.BaseMultiResolutionImage。

文章来源:智云一二三科技

文章标题:java9新特性-14-多分辨率图像 API

文章地址:https://www.zhihuclub.com/184171.shtml

关于作者: 智云科技

热门文章

评论已关闭

4条评论

  1. ciplox ciprofloxacin hcl for sore throat Finance Minister Maria Fekter of the OVP angered the Social Democrats this week by proposing the caretaker government adopt a provisional 2014 budget that largely rolls over the 2013 spending plan to avert what she called U

  2. Minimum time lapse between luteinizing hormone surge or human chorionic gonadotropin administration and follicular rupture Burlington telecom is not drive or operate machinery if you open the formation of the treatment

网站地图