インフォ FAQ
言語 環境比較
 
Index
 
  Processing 1.0 _ALPHAリファレンスは開発途中である。
もしエラーやコメントがあれば、reas at groupc.netへメールして下さい。
Name  

getPixel()

   
Examples  
void loop() { 
  for(int i=0; i<height; i++) { 
    stroke(i*2); 
    line(0, i, 50, i); 
  } 
  color c = getPixel(mouseX, mouseY); 
  noStroke(); 
  fill(c); 
  rect(50, 0, 50, 100); 
} 
Description  

あらゆるピクセルの色でも読み込むことのできる方法。返された数字は現在の色の範囲に対応して測られているが、RGB値がこの機能によって返される。 colorMode(HSB)によって形を描いている場合でも、返される数字はRGBである。もしリクエストしたピクセルがイメージウィンドウの外にある場合は背景色が返される。

   
Syntax  
getPixel(x, y)
   
Parameters  
x   整数: ピクセルのx-座標

y   整数: ピクセルのy-座標

   
Returns  

color 色

   
Usage   Web & Application
   
Related   setPixel()
pixels[]
   
© 2004- 2001 Massachusetts Institute of Technology and Interaction Design Institute Ivrea
Processing is an open project initiated by Ben Fry and Casey Reas