{"name":"lbSetPicture","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","games":{"ofp":"1.75","ofpe":"1.00","arma1":"1.00","arma2":"1.00","arma2oa":"1.50","tkoh":"1.00","arma3":"0.50"},"since":"ofp 1.75","arma3_since":"0.50","locality":{"argument":"local","effect":"local"},"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]","params":[{"name":"idc","type":"Number","description":"control IDC","type_expr":"Number"},{"name":"index","type":"Number","type_expr":"Number"},{"name":"path","type":"String","description":"path to the picture","type_expr":"String"}],"returns":{"type":"Nothing","type_expr":"Nothing"},"form":"unary","right":{"text":"[idc, index, path]"}},{"syntax":"control lbSetPicture [index, path]","params":[{"name":"control","type":"Control","type_expr":"Control"},{"name":"index","type":"Number","type_expr":"Number"},{"name":"path","type":"String","description":"path to the picture","type_expr":"String"}],"returns":{"type":"Nothing","type_expr":"Nothing"},"form":"binary","left":{"text":"control"},"right":{"text":"[index, path]"}}],"examples":[{"code":["lbSetPicture [101, 0, \"iskoda.paa\"];"]},{"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> 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};"]}],"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."}]}