public class ImagePattern extends ColouredTilingPattern
<p>Realizes tiling pattern with image as tile (mosaic).</p>
<p>Typical usages are the following:</p>
<xmp>
[C#]
Pdf pdf = new Pdf();
Section sec = pdf.Sections.Add();
Graph graph = new Graph(sec, 100, 700);
sec.Paragraphs.Add(graph);
Rectangle rect = new Rectangle(0, 600, 200, 100);
graph.Shapes.Add(rect);
ImagePattern pattern = new ImagePattern(TEST_DATA + "frog.jpg", 50, 50);
or in another way:
Image image = new Image();
image.ImageInfo.File = 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.PatternColorSpace = pattern;
rect.GraphInfo.FillColor = fillColor;
rect.GraphInfo.IsFilled = true;
// image fixed size will be equal tileWidth/tileHeight from constructor (50, 50)
pdf.save(....);
</xmp>
| Constructor and Description |
|---|
ImagePattern(Image image_0,
float tileWidth,
float tileHeight) |
ImagePattern(String fileName,
float tileWidth,
float tileHeight) |
| Modifier and Type | Method and Description |
|---|---|
Object |
completeClone()
Copies all fields.
|
Object |
deepClone()
Copies all fields.
|
getHeight, getPaintType, getTile, getTilingType, getWidth, getxStep, getyStep, setHeight, setPaintType, setTile, setTilingType, setWidth, setxStep, setyStepgetPatternIndex, getPatternType, getRotationAngle, getSkewX, getSkewY, getxPos, getxScale, getyPos, getyScale, setPatternIndex, setPatternType, setRotationAngle, setSkewX, setSkewY, setxPos, setxScale, setyPos, setyScalepublic ImagePattern(Image image_0, float tileWidth, float tileHeight)
public ImagePattern(String fileName, float tileWidth, float tileHeight)
public Object completeClone()
Copies all fields. Tile is copied by value.
completeClone in class ColouredTilingPatternpublic Object deepClone()
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.
deepClone in class ColouredTilingPatternCopyright © 2016 Aspose. All Rights Reserved.