The Picture Object (SAPicture)
* The Picture object is not available in ExcelWriterSE, ExcelWriterLE,
or ExcelWriterFree.
The Picture object represents a single picture in a spreadsheet. To create a Picture object, use
Pictures.CreateFromFile2 or
Pictures.CreateFromFile.
Picture Methods and Properties
*This feature is not available in
ExcelWriterSE, ExcelWriterLE, or ExcelWriterFree.
| Picture Methods and Properties |
| AreaPattern* |
Sets or retrieves the background pattern of a transparent, or partly transparent,
picture. ExcelWriter supports nineteen patterns, listed in the table below.
| No Pattern | 0 |
| 0% Pattern | 1 |
| 50% Pattern | 2 |
| 70% Pattern | 3 |
| 25% Pattern | 4 |
| Dark Horizontal | 5 |
| Dark Vertical | 6 |
| Dashed Downward Diagonal | 7 |
| Dashed Upward Diagonal | 8 |
| Small Checkerboard | 9 |
| Trellis | 10 |
| Light Horizontal | 11 |
| Light Vertical | 12 |
| Wide Downward diagonal | 13 |
| Dark Upward diagonal | 14 |
| Small Grid | 15 |
| 60% Pattern | 16 |
| 20% Pattern | 17 |
| 10% Pattern | 18 |
The following example demonstrates setting the AreaPattern of a picture to Trellis.
Set Picture = ws.Pictures.CreateFromFile(2, 70, 5, 80, "C:\sample.jpg")
picture.areapattern = 10
Top |
| BorderLineType* |
Sets or retrieves the borderline type of a picture. ExcelWriter supports nine
BorderLineTypes, listed in the following table.
| Solid | 0 |
| Dash | 1 |
| Dot | 2 |
| Dash-Dot | 3 |
| Dash-Dot-Dot | 4 |
| Dark Gray | 5 |
| Medium Gray | 6 |
| Light Gray | 8 |
The following example sets BorderLineType to Dash-Dot-Dot.
Set Picture = ws.Pictures.CreateFromFile(2, 70, 5, 80, "C:\sample.jpg")
picture.borderlinetype = 4
Top |
| BorderWeight* |
Sets or retrieves the weight of the border line of a picture. BorderWeight has
four possible values, listed in the following table.
| HairLine | 0 |
| SingleLine | 1 |
| MediumLine | 2 |
| WideLine | 3 |
The following example sets BorderWeight to WideLine.
Set Picture = ws.Pictures.CreateFromFile(2, 70, 5, 80, "C:\sample.jpg")
picture.borderweight = 3
Top |
| HasShadow* |
When set to True, displays a picture with a shadow effect. HasShadow is False by default.
To enable HasShadow, use,
Top |
| LowerDeltaX* |
Specifies the picture's horizontal offset from its lower right corner column. If the
LowerDeltaX value is negative, the picture's right border will be offset to the left. If the LowerDeltaX value is
positive, the picture's right border will be offset to the right.
The following example will display the picture offset to the right of its right-border column.
picture.LowerDeltaX = 200
Top |
| LowerDeltaY* |
Specifies the picture's vertical offset from its lower right corner row. If the
LowerDeltaY value is negative, the picture's bottom border will be offset upward. If the LowerDeltaY value is
positive, the picture's bottom border will be offset downward.
The following example will display the picture offset upward of its bottom row.
picture.LowerDeltaY = -200
Top |
| Move* |
Moves the picture to a specified location. Move takes four parameters that determine the new
position of the picture in the worksheet:
picture.move UpperLeftColumn, UpperLeftRow, LowerRightColumn, LowerRightRow
To re-position your picture at upper-left corner J9 and lower-right corner V16, use,
Top |
| UpperDeltaX* |
Specifies the picture's horizontal offset from its upper left corner column. If the
UpperDeltaX value is negative, the picture's left border will be offset to the left. If the UpperDeltaX value is
positive, the picture's left border will be offset to the right.
The following example will display the picture offset to the right of its left-border column.
picture.UpperDeltaX = 200
Top |
| UpperDeltaY* |
Specifies the picture's vertical offset from its upper left corner row. If the
UpperDeltaY value is negative, the picture's top border will be offset upward. If the UpperDeltaY value is
positive, the picture's top border will be offset downward.
The following example will display the picture offset downward of its upper row.
picture.UpperDeltaY = 200
Top |
| *This feature is not available in
ExcelWriterSE, ExcelWriterLE, or ExcelWriterFree.
|
Copyright © 2003, SoftArtisans, Inc.