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;​"iVBORw0KGgoAAAANSUhEUgAA​AEAAAABABAMA...")

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,​iVBORw0KGgoAAAANSUhEUgAAA​B4AAAAlCAIAAADa786bAAAABG​dBTUEAALGPC/xhBQAAACBjSFJ​NAAB6JgAAgIQAAPoAAACA6AAA​dTAAAOpgAAA6mAAAF3CculE8A​AAACXBIWXMAAAsTAAALEwEAmp​wYAAACcmlUWHRYTUw6Y29tLmF​kb2JlLnhtcAAAAAAAPHg6eG1w​bWV0YSB4bWxuczp4PSJhZG9iZ​TpuczptZXRhLyIgeDp4bXB0az​0iWE1QIENvcmUgNS40LjAiPgo​gICA8cmRmOlJERiB4bWxuczpy​ZGY9Imh0dHA6Ly93d3cudzMub​3JnLzE5OTkvMDIvMjItcmRmLX​N5bnRheC1ucyMiPgogICAgICA​8cmRmOkRlc2NyaXB0aW9uIHJk​ZjphYm91dD0iIgogICAgICAgI​CAgICB4bWxuczp0aWZmPSJodH​RwOi8vbnMuYWRvYmUuY29tL3R​pZmYvMS4wLyIKICAgICAgICAg​ICAgeG1sbnM6eG1wPSJodHRwO​i8vbnMuYWRvYmUuY29tL3hhcC​8xLjAvIj4KICAgICAgICAgPHR​pZmY6WVJlc29sdXRpb24+NzI8​L3RpZmY6WVJlc29sdXRpb24+C​iAgICAgICAgIDx0aWZmOkNvbX​ByZXNzaW9uPjU8L3RpZmY6Q29​tcHJlc3Npb24+CiAgICAgICAg​IDx0aWZmOlhSZXNvbHV0aW9uP​jcyPC90aWZmOlhSZXNvbHV0aW​9uPgogICAgICAgICA8eG1wOkN​yZWF0b3JUb29sPkZseWluZyBN​ZWF0IEFjb3JuIDYuMS4zPC94b​XA6Q3JlYXRvclRvb2w+CiAgIC​AgICAgIDx4bXA6TW9kaWZ5RGF​0ZT4yMDE4LTA5LTI0VDA4OjE1​OjU2PC94bXA6TW9kaWZ5RGF0Z​T4KICAgICAgPC9yZGY6RGVzY3​JpcHRpb24+CiAgIDwvcmRmOlJ​ERj4KPC94OnhtcG1ldGE+CpBd​lskAAALeSURBVEgNtVa9b9NAF​PdX4nzacT7rBtEtFSwMBbGwsB​QQYmBkoSCExIRY+BtgYkEIkFh​YWNhBDEyVWFCnCoTUCCHaJqKl​KKT5qOM45tmXXM6O72wEOVnJu​3vv/fy733uXC/9s4ww3nyHMB9​ZBlWx7XuASNz9oOwJ2o95//ej​7t0/dfEU+f6187mopyk7Fy7cX​2XGA+3Dt8/62YZl2pzXcXP9tD​e3l0wo7C7wC6MF+3r1sDk2Pau​9f/RgYI3YWeIUQYJvbrfd9BE1​j9HPXCE0UoEPYT2FR9kGLMV4t​xtlZ4A3v6yt3qoBFoq9e15MZk​VwJtMVLt/RAB17MatKJs8rett​HaM/O6fPGmvrq2gL0Mg3/8YYX​h/heX5Kn9DNL+jrG1cbiz1RtZ​08DK8US1lqqtZGfCPQvU0whd/​Px+/cvHtiecmBR0+e6TmlaJE2​sek9p8m+stBi5gHDSNNy8ajBa​kHpn2LxNxyOQkDxl3ghYPGgPG​waGy7ncsAIG2U/KxWWikQ6dls​lkH9z6CzhVj0/IRb1BLzvv6XS​hucDqsU1kfdR3Waim4SnAawXs​EO6MrQj3oY9blYGit7LA2+qPh​wKbRph70MbS7cUDxDdxzoInPh​adU1kgQpRBQQ0hWXEHAAAZ01h​Sxem2HjkYRJJUR5aSzY4bc0Nf​Bb0U7VQhBEBbAwYAstehsqNse​0hBCOkQjoOFnz4V1P2wu526Iw​Zr6Z6GylACMlDr9kSkdk5tfxz​cOqLh0Mt07tASJh10HjoBDjOL​uPV32JRSrBGuOu3BDh8cXQ06p​rMkgZGsL0x5H9ZmNIVeofU0GI​TujSqls+L2FE4E1RapJCDQAMp​NZMZmVQF9n6rRFSOK0ShMo6nd​akZLpCWuADUGOcKPjV4EaQBxP​Q42/KCOogbWOUsYIgrgbj8UFU​eTT0OZ4hAkScqNjHJACoIA4Wg​E7DJmLwNoFg84DsERqonUEbP7​B21OY2v81/gCA7x3BZlxHxwAA​AABJRU5ErkJggg==";​3;​teal;​shaded;​2 2 4)

4

CloseDrawing()

ADD_PICTURE_01
Scroll to Top