package com
import java
import java
import
import javax
import java
public class Test {
public static void main(String [] args)
{
try {
//本地地址或URL 的圖片
//BufferedImage bi = ImageIO
BufferedImage bi = ImageIO
//截取任意區域的圖片
//BufferedImage subimg = bi
int width = bi
int height = bi
System
System
int [][]datas = new int[width][height];
int [][]datastmp = new int[width][height];
for(int i =
{
for(int j =
{
datas[j][i]= bi
datastmp[j][i]= bi
System
}
System
}
int [][] xz = XZ(datas
for(int i =
{
for(int j =
{
bi
}
}
ImageIO
}
/***
* 圖片旋轉數據處理
* @param datas
* @param width
* @param height
* @param FX
* @return
*/
public static int [][] XZ(int [][] datas
{
try {
int[][] tmps= new int [width][height];
if(FX==
{
for(int i =
{
for(int j =
{
tmps[b][a] = datas[j][i];
}
}
}
else if (FX==
{
for(int i =
{
for(int j =
{
tmps[b][i] = datas[j][i];
}
}
}
return tmps;
} catch (Exception e) {
// TODO: handle exception
System
return null;
}
}
From:http://tw.wingwit.com/Article/program/Java/hx/201311/25710.html