aspose.pdf
Class ImagePattern

java.lang.Object
  extended by aspose.pdf.PatternColorSpace
      extended by aspose.pdf.TilingPattern
          extended by aspose.pdf.ColouredTilingPattern
              extended by aspose.pdf.ImagePattern
Direct Known Subclasses:
ShadingPattern

public class ImagePattern
extends ColouredTilingPattern

Realizes tiling pattern with image as tile (mosaic).

Typical usages are the following:

[Java] Pdf pdf = new Pdf(); Section sec = pdf.getSections().add(); Graph graph = new Graph(sec, 100, 700); sec.getParagraphs().add(graph); Rectangle rect = new Rectangle(0, 600, 200, 100); graph.getShapes().add(rect); ImagePattern pattern = new ImagePattern(TEST_DATA + "frog.jpg", 50, 50); or in another way: Image image = new Image(); image.getImageInfo().setFile(TEST_DATA + "frog.jpg"); ImagePattern pattern = new ImagePattern(image, 20, 20); if image fixed size isn't set it will be equal tileWidth/tileHeight from constructor (20, 20) Color fillColor = new Color(); fillColor.setPatternColorSpace(pattern); rect.getGraphInfo().setFillColor(fillColor); rect.getGraphInfo().setIsFilled(true); // image fixed size will be equal tileWidth/tileHeight from constructor (50, 50) pdf.save(....);


Field Summary
protected  Image image
           
 
Fields inherited from class aspose.pdf.TilingPattern
height, paintType, tile, tilingType, width, xStep, yStep
 
Fields inherited from class aspose.pdf.PatternColorSpace
patternType, rotationAngle, skewX, skewY, xPos, xScale, yPos, yScale
 
Constructor Summary
ImagePattern(Image image, float tileWidth, float tileHeight)
           
ImagePattern(java.lang.String fileName, float tileWidth, float tileHeight)
           
 
Method Summary
 java.lang.Object clone()
          Copies all fields.
 java.lang.Object completeClone()
          Copies all fields.
 void completeCopyTo(ImagePattern pattern)
          Copies all fields.
 void copyTo(ImagePattern pattern)
          Copies all fields.
 
Methods inherited from class aspose.pdf.ColouredTilingPattern
completeCopyTo, copyTo
 
Methods inherited from class aspose.pdf.TilingPattern
completeCopyTo, copyTo, getHeight, getPaintType, getTile, getTilingType, getWidth, getxStep, getyStep, setHeight, setPaintType, setTile, setTilingType, setWidth, setxStep, setyStep
 
Methods inherited from class aspose.pdf.PatternColorSpace
copyTo, getPatternIndex, getPatternType, getRotationAngle, getSkewX, getSkewY, getxPos, getxScale, getyPos, getyScale, setPatternIndex, setPatternType, setRotationAngle, setSkewX, setSkewY, setxPos, setxScale, setyPos, setyScale
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

image

protected Image image
Constructor Detail

ImagePattern

public ImagePattern(Image image,
                    float tileWidth,
                    float tileHeight)

ImagePattern

public ImagePattern(java.lang.String fileName,
                    float tileWidth,
                    float tileHeight)
Method Detail

completeClone

public java.lang.Object completeClone()
Copies all fields. Tile is copied by value.

Overrides:
completeClone in class ColouredTilingPattern

clone

public java.lang.Object clone()
Copies all fields. Tile is copied by reference. Shell be used for patterns that use one tile but different colors or matrix or steps or width, height.

Overrides:
clone in class ColouredTilingPattern

copyTo

public void copyTo(ImagePattern pattern)
Copies all fields. Tile is copied by reference. Shell be used for patterns that use one tile but different colors or matrix or steps or width, height.


completeCopyTo

public void completeCopyTo(ImagePattern pattern)
Copies all fields. Tile is copied by value.