3.displayDensity()
Name(名称):displayDensity()//显示屏密度判断函数
Examples(例子):
void setup() {
size(100, 100);
pixelDensity(displayDensity());
noStroke();
}
void draw() {
background(0);
ellipse(30, 48, 36, 36);
ellipse(70, 48, 36, 36);
}
Description(描述):This function returns the number “2” if the screen is a high-density screen (called a Retina display on OS X or high-dpi on Windows and Linux) and a “1” if not. This information is useful for a program to adapt to run at double the pixel density on a screen that supports it.
如果屏幕是一个高密度的屏幕(在OS X上的视网膜显示或在Windows和Linux上的high – dpi上显示的视网膜)函数返回“1”;如果不是的话,这个函数将返回数字“2”。这个信息对于一个程序来说是有用的,它可以在支持它的屏幕上以双倍的像素密度运行。
Syntax(语法):displayDensity()
displayDensity(display)
Parameters (参数):display——the display number to check显示号码检查
Returns(返回值):int
Related(相关函数):pixelDensity()
size()
- 本文固定链接: http://iprocessing.cn/2017/07/03/displaydensity显示屏密度判断函数/
- 转载请注明: 卡萨布兰卡 于 Processing编程艺术 发表