| 注册
请输入搜索内容

热门搜索

Java Linux MySQL PHP JavaScript Hibernate jQuery Nginx
b4c2
10年前发布

Java 对图像进行90度旋转

   public BufferedImage rotate90DX(BufferedImage bi)  {      int width = bi.getWidth();      int height = bi.getHeight();             BufferedImage biFlip = new BufferedImage(height, width, bi.getType());             for(int i=0; i<width; i++)          for(int j=0; j<height; j++)              biFlip.setRGB(height-1-j, width-1-i, bi.getRGB(i, j));             return biFlip;  }      public BufferedImage rotate90SX(BufferedImage bi)  {      int width = bi.getWidth();      int height = bi.getHeight();             BufferedImage biFlip = new BufferedImage(height, width, bi.getType());             for(int i=0; i<width; i++)          for(int j=0; j<height; j++)              biFlip.setRGB(j, i, bi.getRGB(i, j));             return biFlip;  }