-1

少し恥ずかしいかもしれませんが、ごめんなさい。画像サイズの平均寸法を計算する方法を教えてください。

Dimension d = new Dimension (d);
//where: 
int width = (int)d.getWidth
int heigth = (int)d.getHeigth

===> image size = (width, length);
//Example
image1 = (200, 350);
image2 = (250, 280);
image3 = (340, 260);

3 つの画像の平均サイズはどのように計算できますか???

4

1 に答える 1

1
Dimension result = new Dimension()
result.width = image1.getWidth() + image2.getWidth() + image3.getWidth();
result.height = image1.getHeight() + image2.getHeight() + image3.getHeight();
result.width /= 3;
result.height /= 3;

基本的に、他の平均と同じように行うだけです。

于 2013-07-09T19:32:12.840 に答える