public static void main(String[] args)
{
BufferedImage readImage = null;
try
{
readImage = ImageIO.read(new File("img.png"));
}
catch (Exception e)
{
e.printStackTrace();
readImage = null;
}
int w = readImage.getWidth();
int h = readImage.getHeight();
BufferedImage writeImage = new BufferedImage(w, h, BufferedImage.TYPE_INT_ARGB);
for (int x = 0; x < w; x++) {
for (int y = 0; y < h; y++) {
int c = readImage.getRGB(x, y);
}
}
この結果をテキストファイルに保存したいです。
また間違っているところがあれば教えていただきたいです( ;∀;)。
回答1件
あなたの回答
tips
プレビュー