Personally I would not save the pictures at all. I would save the names or numbers of the selected joints as a string.
Above I called them c1, c2 etc.
So before saving, in a loop check if a joint is selected:
string lsSelected, lsName
long lRow, lJoints = 42 //???
for lRow = 1 to lJoints
lsName = 'c' + string ( lRow)
if describe ( lsName + '.pen.color' ) = '255' then
lsSelected += lsName + ','
end if
next
dw... setItem ( 1 , 'joints' , lsSelected )
Similarly when displaying from database
loop through and set the color='255' for the previously selected