iphone-4

How use CGImageCreateWithImageInRect for iPhone 4 (HD)?

試著忘記壹切 提交于 2019-11-27 12:19:03
问题 I use the following code to getting images from the sprite. And it works fine everywhere except the iPhone 4 (HD version). - (UIImage *)croppedImage:(CGRect)rect { CGImageRef image = CGImageCreateWithImageInRect([self CGImage], rect); UIImage *result = [UIImage imageWithCGImage:image]; CGImageRelease(image); return result; } The iPhone 4 automatically load HD version of the image (sprite@2x.png) instead sprite.png. The original image has a scale 2, but the resulting image has a scale 1 and

Detect retina screen/iPhone 4 in iPhone SDK

*爱你&永不变心* 提交于 2019-11-27 12:06:59
In my application I am downloading some images from the web (from my server to be precise), in order to save some bandwith and especially memory on the phone, I provide them in two resolutions: 480x320 for the "old" iPhone series and in 960x640 for the iPhone 4 with the retina display. Now I need to be able to detect from within the app when it is running on a device that supports the retina screen. How could I do that? I have been thinking about using the code snippet below which would return me a specific device identifier such as eg. "iPhone3", yet then I would be limiting the detection to

Xcode: Could not locate device support files

故事扮演 提交于 2019-11-27 05:02:03
问题 As i am trying to run my application from newly updated Xcode 8 to my iPhone 4 which is running iOS 7.1.2 It throws below error, And, this is my Xcode version, Does anyone faced this issue before? Awaiting for your suggestions!! 回答1: I had a similar problem because the app store version was missing iOS 10.1 support in Xcode 8 and they haven't rolled an update yet. This caused the "Xcode: Could not locate device support files" problem. You can download the latest update https://developer.apple

Compensating compass lag with the gyroscope on iPhone 4

 ̄綄美尐妖づ 提交于 2019-11-27 04:11:02
问题 I've been experimenting with the compass and gyroscope on iPhone 4 and would like some help with an issue I'm having. I want to compensate for the slowness of the compass by using data from the gyroscope. Using CMMotionManager and its CMDeviceMotion object ( motionManager.deviceMotion ), I get the CMAttitude object. Correct me if I'm wrong (please), but here is what I've deduced from the CMAttitude object's yaw property (I don't need pitch nor roll for my purposes): yaw ranges from 0 to PI

iPhone 4 Camera Specifications - Field of View / Vertical-Horizontal Angle

强颜欢笑 提交于 2019-11-27 02:58:37
Does someone know the field of view values for the new iPhone4 camera? I'm doing some AR app's, and I want to know the horizontal and vertical angle of the rear camera. Thanks! If the sensor is 3.39 mm tall (referenced to landscape mode), then half that is 1.695 mm. Focal length for the iPhone 4 is listed as 3.85 mm. atan(1.695/3.85) is 23.75 degrees from center to top, or 47.5 degrees top to bottom. For the longer dimension 4.52/2 = 2.26 mm, atan(2.26/3.85) = 30.41 center to side, or 60.8 degrees left to right (again referencing with respect to landscape orientation). So 60.8 degrees

What is the best way for supporting both screen resolution of iPhone4 and iPhone5 ? - Auto layout in only iOS6

徘徊边缘 提交于 2019-11-26 20:28:08
问题 Have anyone figured out how to support both screen resolution iPhone4 and iPhone 5 ? In iOS6 we have support of Autolayout. Can that be used for iPhone4-iPhone5 screen i.e. 320x480 and 320x568. If we use auto layout feature for that we will have to keep deployment target minimum to iOS6. What about iOS5 than ? What about iOS5 than ? Do we have to handle it programatically for different screen size ? I searched web and could not find exact answer for that so posting this question though having

iPhone 4 Camera Specifications - Field of View / Vertical-Horizontal Angle

怎甘沉沦 提交于 2019-11-26 10:18:38
问题 Does someone know the field of view values for the new iPhone4 camera? I\'m doing some AR app\'s, and I want to know the horizontal and vertical angle of the rear camera. Thanks! 回答1: If the sensor is 3.39 mm tall (referenced to landscape mode), then half that is 1.695 mm. Focal length for the iPhone 4 is listed as 3.85 mm. atan(1.695/3.85) is 23.75 degrees from center to top, or 47.5 degrees top to bottom. For the longer dimension 4.52/2 = 2.26 mm, atan(2.26/3.85) = 30.41 center to side, or