retina-display

Images for retina screen (@2x)

北战南征 提交于 2019-11-28 02:25:23
Now I am making a Game with spritekit(swift) in Xcode 6. It has to be playable for iPhone 4s and higher. But as far as I know are all iphones from 4s and higher Retina so I can add all images with (750 x 1334 pix) and with @2x.png. So I do not need to add images without @2x.. Am I correct? Example: If you have a 512 x 512 (1x) image and you want it to support (2x and 3x) you have to include those 2 files like this: yourImage.png // (512x512 at 1x) yourImage@2x.png // (1024x1024 at 2x) yourImage@3x.png // (1536x1536 at 3x) " iOS Human Interface Guidelines: Icon and Image Sizes " lists asset

openGL ES retina support

旧街凉风 提交于 2019-11-28 01:00:20
问题 I'm trying to get the avTouch sample code app to run on the retina display. Has anyone done this? In the CALevelMeter class, I've tried the following: - (id)initWithCoder:(NSCoder *)coder { if (self = [super initWithCoder:coder]) { CGFloat f = self.contentScaleFactor; if ([self respondsToSelector:@selector(contentScaleFactor)]) { self.contentScaleFactor = [[UIScreen mainScreen] scale]; } f = self.contentScaleFactor; _showsPeaks = YES; _channelNumbers = [[NSArray alloc] initWithObjects:

Why retina screen coordinate value is twice the value of pixel value

六眼飞鱼酱① 提交于 2019-11-28 00:51:31
问题 My computer is a Mac pro with a 13 inch retina screen. The screen resolution is 1280*800 (default). Using the following code: gWindow = glfwCreateWindow(800, 600, "OpenGL Tutorial", NULL, NULL); //case 1 glViewport(0,0,1600,1200); //case 2 glViewport(0,0,800,600); Case 1 results in a triangle that fits the window. Case 2 results in a triangle that is 1/4th the size of the window. Half of viewport: The GLFW documentation indicates the following (from here): While the size of a window is

iOS simulator scaled bug

孤街醉人 提交于 2019-11-27 23:22:39
Today morning I build and run my xcode project. When simulator launched I saw this: The screen is scaled , I see only 1/4 part, other 3/4 parts are hidden . Did anybody faced with same problem? The issue happens in xCode6, Xcode5 , also in AppCode . I tried to Clean project, switched to iPhone5 screen , iPad , the same problem. Also, this happens with my other iOS projects. Finally, I got the reason why this bug appears at work and not at home :) Because at work I don't have external display ( monitor ), but at home (DELL, non-retina off course) If you want this bug not to appear, just connect

detect retina (HD) display on the server side

China☆狼群 提交于 2019-11-27 22:46:43
I found many questions about Retina Display, but none of the answers were on the server side. I would like to deliver a different image according to the screen, ex (in PHP): if( $is_retina) $thumbnail = get_image( $item_photo, 'thumbnail_retina' ) ; else $thumbnail = get_image( $item_photo, 'thumbnail' ) ; Can you see a way of dealing with this? I can only imagine a test in JavaScript, setting a Cookie. However this requires an initial exchange to set it. Anyone have a better solution? Cookie setting code: (function(){ if( document.cookie.indexOf('device_pixel_ratio') == -1 &&

Nesting Media Queries

我的未来我决定 提交于 2019-11-27 22:44:20
By default I want to give my body element a green border. On a device that supports retina display I want to check for size first. On an ipad I want to give my body a red border and on an iphone I want to give it a blue border. But nesting media queries like so doesn't work: body { border: 1px solid green; } @media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) { @media (max-width: 768px) and (min-width: 320px) { body { border: 1px solid red; } } @media (max-width: 320px) { body { border: 1px solid blue; } } } cirrus No. You need to use the and operator and write that as two

Retina icons (@2x) aren't being used when images are specified in code

夙愿已清 提交于 2019-11-27 21:18:15
问题 I place a play.png image onto my view. When the view initially loads, the iPhone 4 grabs the corresponding play@2x.png file and it looks great. However, when I tap the play button my code swaps it out for the pause.png file. Then, when I tap the pause.png to bring back the play.png it uses the original play.png file (not the @2x version like I thought it would automatically reference). This is the code I tried to use: [button setImage:[UIImage imageNamed:@"play.png"] forState

Saving UIView contents in iOS 4 with real size of the images inside (i.e. scale contentes up for save)

故事扮演 提交于 2019-11-27 18:53:02
I have an UIView with many UIImageViews as subviews. The app runs on iOS4 and I use images with retina display resolution (i.e. the images load with scale = 2) I want to save the contents of the UIView ... BUT ... have the real size of the images inside. I.e. the view has size 200x200 and images with scale=2 inside, I'd like to save a resulting image of 400x400 and all the images with their real size. Now what comes first to mind is to create a new image context and load again all images inside with scale=1 and that should do, but I was wondering if there is any more elegant way to do that?

How do I create a 1px line in Interface Builder?

不问归期 提交于 2019-11-27 17:24:09
Note, I'm looking to make a 1px line, not a 1pt line. Meaning it should be 1px regardless of screen scale (so 0.5pt on Retina devices). I can do this programmatically, but can I do it in the Interface Builder? For example I cannot set a UIView to have a height of less than 1. If I can do it in IB then I don't have to declare an outlet and manually set the frame in awakeFromNib . Xcode 7.3 right down corner: add Height constraint in Pin. Just in case someone else comes here wanting to know how it can be done programmatically, heres how you do it: Interface Builder Make a height constraint in IB

How to test a website for Retina on Windows without an actual Retina display?

爱⌒轻易说出口 提交于 2019-11-27 16:45:51
Is there a way to simulate a Retina display on Windows to test a website for HiDPI displays such as Retina? I run Windows on a standard 24" 1920x1080 monitor. Last night I checked out my website on a friends brand new 15" Retina MacBook Pro and the graphics looked all blurry (far worse than on a regular 15 inch MacBook), while the font was super crisp and sharp, making the logo appear even worse because of the direct comparison. I have followed this tutorial to make my website Retina ready: http://line25.com/tutorials/how-to-create-retina-graphics-for-your-web-designs I used the retina.js