Get iPhone's camera resolution?

前端 未结 6 704
再見小時候
再見小時候 2020-12-19 23:11

Is there any way to get the resolution of the iPhone\'s camera? Apparently the 3G has 1200x1600, and 3GS has 1500x2000, but how do I obtain these values from inside my code

6条回答
  •  轮回少年
    2020-12-19 23:28

    Do you really need to know the resolution of the image to set up the affine transform? Since the view is pre-set-up to cover the width of the screen, you can alter the transform based on what fraction of the screen you want to take up, i.e. if you need the preview to be 160 pixels across, just shrink it 50% from the default. I'm doing this in an app now, and it works on new and old iPhones...

提交回复
热议问题