setting canvas size to device