public static void main(String arg[]) throws IOException {
    int points[] = {
      1, 1, 1, 3, 1, 4, 2, 1, 2, 2, 2, 5, 3, 1, 3, 6, 4, 0, 4, 1, 4, 6, 4, 7, 5, 1, 5, 3, 5, 6, 6,
      1, 6, 3, 6, 6, 7, 1, 7, 3, 7, 6, 8, 1, 8, 2, 8, 3, 8, 4, 8, 5, 8, 6
    };
    Bitmap b = new Bitmap(points);

    System.out.println(b);
    System.out.println("after horizontal flip: ");

    b.flipHorizontal();
    System.out.println(b);

    System.out.println("after vertical flip: ");
    // flip back before flip Vertical
    b.flipHorizontal();
    b.flipVertical();
    System.out.println(b);

    System.out.println("after reverse flip: ");
    // flip back before reverse
    b.flipVertical();
    b.reverse();
    System.out.println(b);
  }
Esempio n. 2
0
 public static void main(String args[]) {
   File f1 = new File("Figura.bmp");
   Bitmap bmp = new Bitmap(f1);
   System.out.println(bmp.equals(bmp));
   // catacteristics of f1
   System.out.println(bmp);
   // copy
   File f2 = new File("Test1.bmp");
   bmp.write(f2);
   // get the raw
   File f3 = new File("Test.raw");
   bmp.getBmpRaw(f3);
   // reisize image
   File f4 = new File("Resized14.bmp");
   bmp.resize025(f4);
   // flip vertical
   File f5 = new File("FlipImageVertical.bmp");
   bmp.flipVertical(f5);
   // flip horizontal
   File f6 = new File("FlipImageHorizontal.bmp");
   bmp.flipHorizontal(f6);
 }