13.pixelHeight
14.pixelWidth
Name(名称):pixelHeight //高分辨率显示屏像素高度
Examples(例子):
size(600, 400);
pixelDensity(2);
println(width, height);
println(pixelWidth, pixelHeight);
Description(描述):When pixelDensity(2) is used to make use of a high resolution display (called a Retina display on OS X or high-dpi on Windows and Linux), the width and height of the sketch do not change, but the number of pixels is doubled. As a result, all operations that use pixels (like loadPixels(), get(), set(), etc.) happen in this doubled space. As a convenience, the variables pixelWidth and pixelHeight hold the actual width and height of the sketch in pixels. This is useful for any sketch that uses the pixels[] array, for instance, because the number of elements in the array will be pixelWidth*pixelHeight, not width*height.
当pixelDensity(2)用于利用高分辨率显示器(在OS X上或在Windows和Linux上的高分辨率的视网膜上)时,草图的宽度和高度不会改变,但是像素的数量增加了一倍。因此,所有使用像素的操作(如loadPixels()、get()、set()等)都发生在这个双倍的空间中。为了方便起见,像素宽度和像素高的变量将像素的实际宽度和高度保持在像素上。这对于任何使用像素[]数组的草图都很有用,因为数组中元素的数量将是像素宽度*像素高度,而不是宽度*高度。
Related(相关函数):pixelWidth
pixelDensity()
displayDensity()
- 本文固定链接: http://iprocessing.cn/2017/07/03/pixelwidth高分辨率显示屏像素宽度/
- 转载请注明: 卡萨布兰卡 于 Processing编程艺术 发表