Processing (BETA) version 135+ のリファレンスです。 旧バージョン使用者はソフトウェア内のリファレンスを参照してください。
この文書は Processing のAPIリファレンスを日本語に訳したものです。 最新の内容は 英語版 で確認して下さい。


Name

image()

Examples
example pic
PImage b;
// Images must be in the "data" directory to load correctly
b = loadImage("laDefense.jpg");
image(b, 0, 0);
example pic
PImage b;
// Images must be in the "data" directory to load correctly
b = loadImage("laDefense.jpg");
image(b, 0, 0);
image(b, 0, 0, width/2, height/2);
Description スクリーンに表示するイメージを指定します。 イメージを正しくロードするにはデータディレクトリを Sketch にしなければなりません。 イメージを追加するには Sketch メニューの "Add file..." を選択します。 Processing は現時点で GIF、JPEG、Targa イメージに対応しています。 イメージの色は tint() で変更することができます。 もし GIF が透明度を持っていた場合、透明度を維持します。 img パラメタは表示するイメージを指定します。 そして x, y パラメタはイメージの左上の位置を定義します。 widthheight パラメタでサイズ指定しない場合、オリジナルサイズで表示します。

imageMode() はパラメタへの作用を変更します。 例えば、imageMode(CORNERS) を指定した場合、 width, height パラメタの値は幅と高さではなく、取り出したい矩形の右下の x, y 座標として認識されます。

リリース0124からはデフォルトレンダラー(JAVA2D)使用時に smooth() を使うと、 リサイズされたイメージの画質を改善することができます。
Syntax
image(img, x, y)
image(img, x, y, width, height)
Parameters
img PImage: the image to display
x int or float: x-coordinate of the image
y int or float: y-coordinate of the image
width int or float: width to display the image
height int or float: height to display the image
Usage Web & Application
Related loadImage()
PImage
imageMode()
tint()
background()
alpha()
Updated on April 20, 2007 01:01:01pm PDT

Creative Commons License

この文書の原文はクリエイティブ・コモンズ(Creative Commons)Attribution-Noncommercial-Share Alike(表示・非営利・継承) ライセンスで公開されています。 このライセンスは同一の許諾条件の下で原作者のクレジットを表示し、また作品を営利目的で利用しなければ、作品に対して複製、頒布、展示、実演、二次的著作物の作成が行えることを示します。

© 2007 Processing.org