Changed to support retina resolution when making a bitmap mask.