{"name":"lbSetPicture","operator":null,"title":"lbSetPicture","type":"command","url":"https://community.bistudio.com/wiki/lbSetPicture","revid":364161,"updated":"2024-05-05T10:46:40Z","groups":["GUI Control - ListBox"],"status":"ok","replaced_by":[],"games":[{"game":"ofp","name":"Operation Flashpoint","version":"1.75"},{"game":"ofpe","name":"Operation Flashpoint: Elite","version":"1.00"},{"game":"arma1","name":"Armed Assault","version":"1.00"},{"game":"arma2","name":"Arma 2","version":"1.00"},{"game":"arma2oa","name":"Arma 2: Operation Arrowhead","version":"1.50"},{"game":"tkoh","name":"Take On Helicopters","version":"1.00"},{"game":"arma3","name":"Arma 3","version":"0.50"}],"since":{"game":"ofp","name":"Operation Flashpoint","version":"1.75"},"arma3_since":"0.50","branch":null,"locality":{"argument":"local","effect":"local","server_exec":false},"exec":null,"description":"Sets the left picture in the row with given index of CT_LISTBOX or CT_COMBO. The picture is searched for in the mission directory, the dtaExt subdirectory of the campaign directory and the dtaExt directory and the data bank (or directory).\n\n> [!NOTE]\n> **Arma 3:** In Arma 3 it might be necessary to set the color of the picture as well with lbSetPictureColor as default color `[0,0,0,0]` makes the picture invisible.","syntaxes":[{"syntax":"lbSetPicture [idc, index, path]","since":null,"effect":null,"exec":null,"params":[{"name":"idc","type":"Number","optional":false,"default":null,"description":"control IDC","types":["Number"],"since":null,"text":"idc: Number - control IDC"},{"name":"index","type":"Number","optional":false,"default":null,"description":null,"types":["Number"],"since":null,"text":"index: Number"},{"name":"path","type":"String","optional":false,"default":null,"description":"path to the picture","types":["String"],"since":null,"text":"path: String - path to the picture"}],"returns":{"type":"Nothing","types":["Nothing"],"description":null,"text":"Nothing"},"form":"unary","operator":null,"left":null,"right":{"text":"[idc, index, path]","types":["Array"]}},{"syntax":"control lbSetPicture [index, path]","since":null,"effect":null,"exec":null,"params":[{"name":"control","type":"Control","optional":false,"default":null,"description":null,"types":["Control"],"since":null,"text":"control: Control"},{"name":"index","type":"Number","optional":false,"default":null,"description":null,"types":["Number"],"since":null,"text":"index: Number"},{"name":"path","type":"String","optional":false,"default":null,"description":"path to the picture","types":["String"],"since":null,"text":"path: String - path to the picture"}],"returns":{"type":"Nothing","types":["Nothing"],"description":null,"text":"Nothing"},"form":"binary","operator":null,"left":{"text":"control","types":["Control"]},"right":{"text":"[index, path]","types":["Array"]}}],"examples":[{"text":"```sqf\nlbSetPicture [101, 0, \"iskoda.paa\"];\n```","code":["lbSetPicture [101, 0, \"iskoda.paa\"];"]},{"text":"```sqf\n_control lbSetPicture [0, \"iskoda.paa\"];\n```","code":["_control lbSetPicture [0, \"iskoda.paa\"];"]},{"text":"> [!NOTE]\n> Adding pictures to lists is very slow. In order to prevent a list filling's possible slowdown, add the pictures in the **scheduled** environment using spawn.\n>\n> One drawback of that method is that sorting the entries is not easily possible.\n\n```sqf\nprivate _path = _ctrlTV tvAdd [[], \"Some Entry\"];\n[_ctrlTV, _path] spawn {\n    (_this select 0) tvSetPictureRight [[_this select 1], \"someImage.paa\"];\n};\n```","code":["private _path = _ctrlTV tvAdd [[], \"Some Entry\"];\n[_ctrlTV, _path] spawn {\n\t(_this select 0) tvSetPictureRight [[_this select 1], \"someImage.paa\"];\n};"]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["lbPicture","lbSetPictureColor","lbSetPictureRight"],"notes":[{"user":"ffur2007slx2_5","date":"2014-09-10T16:31:00Z","text":"More information on the CT_LISTBOX command family can be found here."}],"categories":["ArmA: Armed Assault: Scripting Commands","Arma 2: Operation Arrowhead: Scripting Commands","Arma 2: Scripting Commands","Arma 3: Scripting Commands","Command Group: GUI Control - ListBox","Introduced with Operation Flashpoint version 1.75","Operation Flashpoint: Elite: Scripting Commands","Operation Flashpoint: New Scripting Commands","Operation Flashpoint: Scripting Commands","Scripting Commands","Scripting Commands: Local Effect","Take On Helicopters: Scripting Commands"]}