Something like "turning lemons into lemonade" Is there a Chinese saying roughly equivalent in meaning to "turning lemons into lemonade"?

From Wikipedia,


  "When life gives you lemons, make lemonade" is a proverbial phrase
  used to encourage optimism and a can-do attitude in the face of
  adversity or misfortune. "Lemons" in this expression is used in the
  informal sense of the word, to indicate an unfortunate or inadequate
  situation, a meaning which probably stems from the sour and acidic
  taste of unsweetened lemon. "Lemonade" on the other hand, is a
  sweetened form of this same acerbic fruit, and so in the context of
  this expression, conveys the potential for pleasure and opportunity in
  seemingly bad situations.
There are some phrases of close meanings:


化干戈为玉帛   turn hostility into peace;
转危为安 / 化险为夷       turn danger into safety;
化压力为动力   turn the pressure of life into power;
转悲为喜 turn sorrow into joy;
化悲痛为力量   turn sadness into power;
变废为宝    turn rubbish into useful things;
化失败为教训  turn failure into lessons