retina

MKTileOverlay with Retina-Tiles

回眸只為那壹抹淺笑 提交于 2019-12-06 01:43:25
问题 I have issues to load 512x512px tiles in MKMapKit. The Server provides 512x512 .jpeg tiles. I could not find any solution or sample implementation for custom retina tiles in MKMapView. What I do: When I load them into MKMapView with overlay = [[MKTileOverlay alloc] initWithURLTemplate:template]; overlay.tileSize = CGSizeMake(512.0f, 512.0f); [_mapView insertOverlay:overlay atIndex:MAP_OVERLAY_INDEX_TILE level:MKOverlayLevelAboveLabels]; … tiles are scaling correct but only half of them is

window.devicePixelRatio change listener

断了今生、忘了曾经 提交于 2019-12-05 21:17:51
问题 window.devicePixelRatio will return 1 or 2 depending on if I'm using my retina monitor or standard. If I drag the window between the two monitors, this property will change. Is there a way I can have a listener fire when the change occurs? 回答1: You can listen to a media query with matchMedia that will tell you when the devicePixelRatio goes past a certain barrier (unfortunately not for arbitrary scale changes). e.g: window.matchMedia('screen and (min-resolution: 2dppx)'). addListener(function

How To Save PNG file From NSImage (retina issues) The Right Way?

孤街浪徒 提交于 2019-12-05 10:36:57
I am trying to save each image in an array as a .PNG file (also as the right size, without scaling up because of retina mac dpi issues) and can't seem to find a solution. NONE of the solutions at How to save PNG file from NSImage (retina issues) seem to be working for me. I've tried each one and each of them would still save a 72x72 file as 144x144 in retina .etc. More specifically I am looking for an NSImage category (yes, I am working in the Mac environment) I am trying to have the user Choose a directory to save them in and execute the saving of the images from array like this: - (IBAction

Is there any media query for non-retina display?

非 Y 不嫁゛ 提交于 2019-12-04 10:08:51
According to an article on CSS-Tricks , the future proof media queries for retina display can be wrote as: @media only screen and (-webkit-min-device-pixel-ratio: 2), only screen and ( min--moz-device-pixel-ratio: 2), only screen and ( -o-min-device-pixel-ratio: 2/1), only screen and ( min-device-pixel-ratio: 2), only screen and ( min-resolution: 192dpi), only screen and ( min-resolution: 2dppx) { /* Retina-specific stuff here */ } What if I want to write CSS codes for non-retina display? I know you can write some CSS codes for non-retina display first, and then overwrite it for retina display

MKTileOverlay with Retina-Tiles

风流意气都作罢 提交于 2019-12-04 05:36:06
I have issues to load 512x512px tiles in MKMapKit. The Server provides 512x512 .jpeg tiles. I could not find any solution or sample implementation for custom retina tiles in MKMapView. What I do: When I load them into MKMapView with overlay = [[MKTileOverlay alloc] initWithURLTemplate:template]; overlay.tileSize = CGSizeMake(512.0f, 512.0f); [_mapView insertOverlay:overlay atIndex:MAP_OVERLAY_INDEX_TILE level:MKOverlayLevelAboveLabels]; … tiles are scaling correct but only half of them is loaded (not only visually - i sniffed the requests and the tiles are missing) with overlay = [

Org LaTeX preview is fuzzy on retina displays

廉价感情. 提交于 2019-12-03 14:09:09
问题 I have been using Emacs 24.4 for all my math/scientific notes. org-latex-preview is fantastic for this! But recently, I upgraded to a macbook pro with retina display, and I now see that all my equations in org-mode are... fuzzy. Is there a setting I can change to up-res these? Here is a screenshot: Thanks! 回答1: A couple of years back, I decided to fix this and wrote a patch to add dvisvgm as a render option for latex previews. While this worked great, I never submitted it (no time or

Org LaTeX preview is fuzzy on retina displays

此生再无相见时 提交于 2019-12-03 03:21:02
I have been using Emacs 24.4 for all my math/scientific notes. org-latex-preview is fantastic for this! But recently, I upgraded to a macbook pro with retina display, and I now see that all my equations in org-mode are... fuzzy. Is there a setting I can change to up-res these? Here is a screenshot: Thanks! A couple of years back, I decided to fix this and wrote a patch to add dvisvgm as a render option for latex previews. While this worked great, I never submitted it (no time or knowledge on how to officially patch org). Today, I was thrilled to discover that org-mode v9.0.6, now has this

Issue with loading and caching retina images for UIImageView animation

匿名 (未验证) 提交于 2019-12-03 01:25:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: What I have For my game I'm creating several animations using view.animationImages = imagesArray; [view startAnimating]; In my animation helper class I use this - (UIImage *)loadRetinaImageIfAvailable:(NSString *)path { NSString *retinaPath = [[path stringByDeletingLastPathComponent] stringByAppendingPathComponent:[NSString stringWithFormat:@"%@@2x.%@", [[path lastPathComponent] stringByDeletingPathExtension], [path pathExtension]]]; if ([UIScreen mainScreen].scale == 2.0 && [[NSFileManager defaultManager] fileExistsAtPath:retinaPath] == YES

Gradient texture has wrong scale on retina Mac

人盡茶涼 提交于 2019-12-02 15:58:45
问题 I wrote a gradient generating function as a category on SKTexture. It works well on 1x screens but retina renders the texture too big, double width and double height ie wrong scale. I have been trying to get it right by changing between pixels and points, but can't get it right. Can someone help me please? +(SKTexture*)gradientWithSize:(const CGSize)SIZE colors:(NSArray*)colors { // Hopefully this function would be platform independent one day. // Correct way to find scale? DLog(@

Media query for high resolution mobile 1080px (Xperia Z etc)

点点圈 提交于 2019-12-01 19:20:05
I am trying to get to grips with media queries for different devices. I have tried my new Sony Xperia Z mobile and displays in full scale site format due to the high resolution. How do I add a media query to re-size a grid and format like a standard mobiles scale? On the Xperia the font is also too small to read and needs to show bigger. Is this a problem for retina devices that act like full size monitor displays? Xperia Z - resolution 1920 × 1080, PPI 443 How do I include media queries for such devices? Timidfriendly This code targets all devices with the same pixel ratio, which is actually