AddPicture
Modified in version 5.0
AddPicture ( left ; top ; width ; height ; sourceType ; sourceData ; borderStroke ; borderColor ; borderColorVariant ; shadowEffect ; shadowColor )
Argument | Type | Range | Default | Note |
---|---|---|---|---|
left | num | -inf..+inf | (required) | |
top | num | -inf..+inf | (required) | |
width | num | 0..10000 | (image width) | Dimension:[pt] |
height | num | 0..10000 | (image height) | Dimension:[pt] |
sourceType | int | 1..4 | clipboard | |
sourceData | str | "" | ||
borderStroke | num[] | 0..1000 | 0 | Dimension:[pt], requires xmCHART 5.0 or higher |
borderColor | rgba | 0..255 | black | Requires xmCHART 5.0 or higher |
borderColorVariant | int | -1..128 | solid | Requires xmCHART 5.0 or higher |
shadowEffect | num[] | -1000..1000 | 0 | Requires xmCHART 5.0 or higher |
shadowColor | rgba | 0..255 | #888a | Requires xmCHART 5.0 or higher |
Examples
AddPicture(100;100;;;file;"images/gradient_01.png")
AddPicture(100;100;;;file;"~/fills/gradient_02.png")
AddPicture(100;100;;;file;"C:/Programs/Fills/Gradient003.png")
AddPicture(100;100;;;stream;"iVBORw0KGgoAAAANSUhEUgAAAEAAAABABAMA...")
Description
By using the AddPicture() function, it is possible to add a picture, e.g. a company logo, to a drawing. Two different picture sources are supported for this: a file (sourceType = file) or a Base64 encoded PNG image stream (sourceType = stream). The arguments sourceType and sourceData are explained in detail in Import Images, together with various examples showing how they are applied. Moreover, by using the arguments borderStroke, borderColor, borderColorVariant, shadowEffect and shadowColor the border and shadow can be varied.
The upper left-hand corner of the picture is positioned by using the arguments left and top. The coordinate origin is located in the upper left-hand corner of the drawing or the view. The arguments width and height serve to scale the picture. If the width and height are not defined, the actual width and height of the picture are used.
| ADD_PICTURE_01 |
1 | OpenDrawing(50;60) |
2 | AddPicture(10;10;;;stream; |
3 | "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAlCAIAAADa786bAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF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