首页 > 文档 > pixelDensity()高分辨率显示屏启用
2017
07-03

pixelDensity()高分辨率显示屏启用

  1. pixelDensity()

Name名称):pixelDensity()//高分辨率显示屏启用

Examples例子):

 

size(100, 100);

pixelDensity(2);

noStroke();

background(0);

ellipse(30, 48, 36, 36);

ellipse(70, 48, 36, 36);

 

Description描述):This function is new with Processing 3.0. It makes it possible for Processing to render using all of the pixels on high resolutions screens like Apple Retina displays and Windows High-DPI displays. This function can only be run once within a program and it must be used right after size() in a program without a setup() and used within setup() when a program has one. The pixelDensity() should only be used with hardcoded numbers (in almost all cases this number will be 2) or in combination with displayDensity() as in the third example above. To use variables as the arguments to pixelDensity() function, place the pixelDensity() function within the settings() function. There is more information about this on the settings() reference page.

这个函数是processing3.0的新函数。它使得处理高分辨率屏幕上的所有像素(如苹果视网膜显示器和Windows high – dpi显示器)变得可能。这个函数只能在一个程序中运行一次,而且它必须在一个没有size()的程序中使用,并且在一个程序有一个的时候在setup()中使用。pixelDensity()应该只用于硬编码的数字(在几乎所有情况下,这个数字将是2)或与displayDensity()相结合,就像上面的第三个例子一样。要使用变量作为pixelDensity()函数的参数,在settings()函数中放置pixelDensity()函数。在settings()参考页面上有更多关于这个的信息。

Syntax(语法):pixelDensity(density)

Parameters (参数):density——1 or 2

Returns返回值):Void(

 

 

 

 

 



最后编辑:
作者:卡萨布兰卡
这个作者貌似有点懒,什么都没有留下。

留下一个回复

你的email不会被公开。