Ejemplo n.º 1
0
 /** Method to create a collage of several pictures */
 public void createCollage() {
   Picture flower1 = new Picture("flower1.jpg");
   Picture flower2 = new Picture("flower2.jpg");
   this.copy(flower1, 0, 0);
   this.copy(flower2, 100, 0);
   this.copy(flower1, 200, 0);
   Picture flowerNoBlue = new Picture(flower2);
   flowerNoBlue.zeroBlue();
   this.copy(flowerNoBlue, 300, 0);
   this.copy(flower1, 400, 0);
   this.copy(flower2, 500, 0);
   this.mirrorVertical();
   this.write("collage.jpg");
 }
Ejemplo n.º 2
0
  /** Method to create a collage of several pictures */
  public void createCollage() {
    Picture pic2 = new Picture("moon-surface.jpg");

    Picture picNoBlue = new Picture(pic2);
    picNoBlue.zeroBlue();

    Picture effect1 = new Picture(pic2);
    effect1.edgeDetection(10);

    Picture effect2 = new Picture(pic2);

    this.copy(effect1, 250, 600);
    this.copy(pic2, 0, 600);
    effect2.mirrorVertical();
    this.copy(effect2, 250, 0);

    this.copy(picNoBlue, 0, 0);

    this.write("collage.jpg");
  }
Ejemplo n.º 3
0
 /* Main method for testing - each class in Java can have a main
  * method
  */
 public static void main(String[] args) {
   Picture beach = new Picture("beach.jpg");
   beach.explore();
   beach.zeroBlue();
   beach.explore();
 }