Изменена картинка на bmp

This commit is contained in:
Victor 2013-09-17 10:13:19 +03:00
parent b42c0dc7a0
commit be6cf7d8d7
3 changed files with 78 additions and 78 deletions

BIN
src/res/images/lena.bmp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 192 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

View File

@ -35,7 +35,7 @@ public class ImageScaleDown extends JFrame {
panel.setLayout(new BorderLayout());
panel.setBorder(new EmptyBorder(10, 10, 10, 10));
BufferedImage source = (BufferedImage) Util.readImageRes("lena.png");
BufferedImage source = (BufferedImage) Util.readImageRes("lena.bmp");
panel.add(new JLabel(new ImageIcon(source)), BorderLayout.WEST);
BufferedImage dest = scaleDown(source);
@ -70,7 +70,7 @@ public class ImageScaleDown extends JFrame {
pixel += src[ (y*2+1) * w + (x*2+1) ] & 0xFF;
pixel = pixel / 4;
dest[y * newWidth + x] = 0xFF000000 | (pixel << 16) | (pixel << 8) | pixel;
dest[y * newWidth + x] = 0xFF000000 | (pixel << 16) | (pixel << 8) | (pixel);
}
}
return dest;