/* 
 * Copyright 2001-2013 Aspose Pty Ltd. All Rights Reserved.
 *
 * This file is part of Aspose.Slides. The source code in this file
 * is only intended as a supplement to the documentation, and is provided
 * "as is", without warranty of any kind, either expressed or implied.
 */
 
package programmersguide.powerpoint2007.workingwithshapesex.fillshapeexwithpicture.java;

import com.aspose.slides.*;
import javax.imageio.ImageIO;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;

public class FillShapeExWithPicture
{
    public static void main(String[] args) throws Exception
    {
        // The path to the documents directory.
        String dataDir = "src/programmersguide/powerpoint2007/workingwithshapesex/fillshapeexwithpicture/data/";

        //Instantiate PresentationEx class that represents the PPTX
        PresentationEx pres = new PresentationEx();


        //Get the first slide
        SlideEx sld = pres.getSlides().get_Item(0);

        //Add auto shape of rectangle type
        int idx = sld.getShapes().addAutoShape(ShapeTypeEx.Rectangle, 50, 150, 75, 150);
        ShapeEx shp = sld.getShapes().get_Item(idx);


        //Set the fill type to Picture
        shp.getFillFormat().setFillType(FillTypeEx.Picture);

        //Set the picture fill mode
        shp.getFillFormat().getPictureFillFormat().setPictureFillMode(PictureFillModeEx.Tile);

        //Creating a Buffered Image object to hold the image file
        BufferedImage image=null;

        try {
            image = ImageIO.read(new File(dataDir + "asp.jpg"));
        } catch (IOException e) {
        }

        ImageEx imgx = pres.getImages().addImage(image);

        shp.getFillFormat().getPictureFillFormat().getPicture().setImage(imgx);

        //Write the PPTX file to disk
        pres.write(dataDir + "RectShpPic.pptx");

        //Printing the status
        System.out.println("Shape added and filled with picture successfully!");
    }
}





@@ -1,12 +1,11 @@
 /* 
-%0D
 %0A * Copy
@@ -60,13 +60,11 @@
 ved.
-%0D
 %0A *
-%0D
 %0A * 
@@ -127,17 +127,16 @@
 his file
-%0D
 %0A * is o
@@ -201,17 +201,16 @@
 provided
-%0D
 %0A * %22as 
@@ -276,17 +276,14 @@
 ied.
-%0D
 %0A */
-%0D
 %0A 
-%0D
 %0Apac
@@ -367,19 +367,17 @@
 re.java;
-%0D%0A%0D
+%0A
 %0Aimport 
@@ -396,17 +396,16 @@
 lides.*;
-%0D
 %0Aimport 
@@ -426,17 +426,16 @@
 ImageIO;
-%0D
 %0Aimport 
@@ -463,17 +463,16 @@
 edImage;
-%0D
 %0Aimport 
@@ -484,17 +484,16 @@
 io.File;
-%0D
 %0Aimport 
@@ -512,19 +512,17 @@
 ception;
-%0D%0A%0D
+%0A
 %0Apublic 
@@ -553,12 +553,10 @@
 ture
-%0D
 %0A%7B
-%0D
 %0A   
@@ -615,16 +615,14 @@
 tion
-%0D
 %0A    %7B
-%0D
 %0A   
@@ -665,17 +665,16 @@
 rectory.
-%0D
 %0A       
@@ -778,19 +778,17 @@
 /data/%22;
-%0D%0A%0D
+%0A
 %0A       
@@ -847,17 +847,17 @@
 the PPTX
-%0D
+.
 %0A       
@@ -900,21 +900,18 @@
 ionEx();
-%0D%0A%0D%0A%0D
+%0A%0A
 %0A       
@@ -932,17 +932,16 @@
 st slide
-%0D
 %0A       
@@ -984,19 +984,17 @@
 Item(0);
-%0D%0A%0D
+%0A
 %0A       
@@ -1028,17 +1028,16 @@
 gle type
-%0D
 %0A       
@@ -1117,17 +1117,16 @@
 5, 150);
-%0D
 %0A       
@@ -1170,21 +1170,18 @@
 em(idx);
-%0D%0A%0D%0A%0D
+%0A%0A
 %0A       
@@ -1211,17 +1211,16 @@
  Picture
-%0D
 %0A       
@@ -1272,19 +1272,17 @@
 icture);
-%0D%0A%0D
+%0A
 %0A       
@@ -1309,17 +1309,16 @@
 ill mode
-%0D
 %0A       
@@ -1404,19 +1404,17 @@
 x.Tile);
-%0D%0A%0D
+%0A
 %0A       
@@ -1471,17 +1471,16 @@
 age file
-%0D
 %0A       
@@ -1505,19 +1505,17 @@
 ge=null;
-%0D%0A%0D
+%0A
 %0A       
@@ -1520,17 +1520,16 @@
    try %7B
-%0D
 %0A       
@@ -1585,17 +1585,16 @@
 .jpg%22));
-%0D
 %0A       
@@ -1619,17 +1619,16 @@
 ion e) %7B
-%0D
 %0A       
@@ -1629,19 +1629,17 @@
        %7D
-%0D%0A%0D
+%0A
 %0A       
@@ -1687,19 +1687,17 @@
 (image);
-%0D%0A%0D
+%0A
 %0A       
@@ -1768,19 +1768,17 @@
 e(imgx);
-%0D%0A%0D
+%0A
 %0A       
@@ -1807,17 +1807,16 @@
  to disk
-%0D
 %0A       
@@ -1856,19 +1856,17 @@
 .pptx%22);
-%0D%0A%0D
+%0A
 %0A       
@@ -1887,17 +1887,16 @@
 e status
-%0D
 %0A       
@@ -1972,24 +1972,17 @@
 !%22);
-%0D
 %0A    %7D
-%0D
 %0A%7D
-%0D%0A%0D%0A%0D%0A%0D%0A%0D
+%0A%0A%0A%0A
 %0A

remove large sized previous commits 1