Dont know which camera code you are using, but there is a good thread here about that matter.

Hope it helps.