How to create an image picker
For example, the code that allows concrete5 to create the color picker is:
<div hex-color="<?php echo $st->getValue()?>" style="background-color: <?php echo $st->getValue()?>"></div>
$al = Loader::helper('concrete/asset_library');
Then, for each image picker, use this code:
Note that the "$fID" variable will need to be changed to whatever you're using for the File ID. Also, the two instanced of 'fID' in quotes on the second line need to be changed to whatever the variable name is as well (this is what the control will POST the chosen file id to). The word 'Image' is a label, so you can change that to something more appropriate (like 'Background Image' in your case).
Also note that this code is just for the display of the image picker. You'll need some code on the back-end to receive the POST'ed file ID(s) and save them in the database somewhere.
E.g. my css looks like this:
and I need to figure out what the corresponding concrete5 image ID is for myimage.png'.
I've been looking athttp://www.concrete5.org/documentation/developers/files/files-and-f... with no luck yet.
However, note that this is probably not a great idea, because if the user modifies the file in the file manager (edits/resizes it, replaces it with a new upload, etc.) then the file version you're referring to is no longer valid.
I'm not sure how you're going about this, but I would step back and think how you can do this so that you're only ever dealing with file id numbers, and then when it's time to display an image you retrieve the file by its ID and display it -- but never should you go in the other direction and try to get to a file ID by starting with a path or URL.