Capture Image of Arbitrary Space or Desktop - objective-c

When you enter mission control, you are shown thumbnails of all your spaces / desktops:
I was wondering if it is possible to programmatically acquire these images within an OSX application -- preferably at full resolution.

Related

Custom MapIcon image wrong size in UWP app

I've got a UWP app with a map view. For some of my MapIcons, I need to set a custom image. Others use the default image. My custom image is approximately the same size as the default image. Additionally, I generated different sizes for different screen scales, and named them accordingly (for example, MyIcon.scale-200.png, etc).
I tested this by running the app on my computer, a Surface Pro, and setting the scaling to different values in the Settings app. It seems to work. As I choose larger scales, I get larger custom MapIcons, and the custom icon is similar in size to the default icon.
However, my customers report that it is not working correctly when I distribute my app. They are sending me screen shots that show the custom MapIcon either much larger, or noticeably smaller than the default one. I can't reproduce or explain these results.
What could cause this?

Icon or image (PNG), which is the most performative?

I'm working on a project that involves displaying a map (https://github.com/react-native-community/react-native-maps) and there are 34 possible types of picture pins (PNG) and I'd like to know which becomes more performative. Keep using these images or adopt the use of icons? Taking into account that the images have on average 10Kb
For those who do not know, converting to SVG can turn into an icon (https://github.com/oblador/react-native-vector-icons)

OS X Screensaver: Retina Thumbnail Image

I'm developing a screensaver for OS X using Xcode's screensaver template. By inspecting the package contents of system screensavers, I've found that the thumbnails used in the System Preferences list of screensavers are derived from two files in the screensaver bundle:
thumbnail.png (90x58)
thumbnail#2x.png (180x116)
I have created two images of these sizes and placed them in my screensaver bundle. However, the System Preferences panel on my retina screen appears to load the non-retina asset. Here is a screenshot of the System Preferences panel next to a QuickLook preview of the thumbnail#2x.png image:
I'm out of ideas. Anyone know what could be causing this and how I can stop it? Things I have tried:
Using tiffs instead of PNGs. -- Same result.
Naming the retina-sized asset thumbnail.png -- Same result.
Turned off "combine high-resolution artwork" in Xcode's build configuration. -- Same result.
Deleting the thumbnail assets altogether. Interestingly, the System Preferences panel does not go back to drawing a default thumbnail icon. Instead, it draws an empty white rectangle. This led me to believe there might be caching going on, so I spent some time trying to find where that would be. Cleared preferences, etc.
Oddities
If you inspect a system screensaver's package bundle, you'll find that the two thumbnail files don't report dimensions in the Finder. And if you open them with Sketch, they BOTH appear as 90x58 to that app. (Although Photoshop shows the #2x asset as 180x116). The thumbnails from the system screensavers have the gloss effect already applied, whereas my thumbnail gets that effect automatically even though the image asset does not contain it.
I'm starting to think there's something fishy about the way the panel loads/draws these images. Maybe somebody knows something I don't?

Retina graphics vs non-retina graphics management

I am about to launch a new app and would lik eto increase quality of the graphics. In my case the graphics is the logo and the custom buttons. I do not know if this impact Core Plot but that is also part of the package.
There is quite a few posts about this but there are still things i do not fully understand.
I am reading this quote from "amattn":
It's trivial:
1.Only include #2x images in your project.
2.Make sure those images have the #2x suffix.
The system will automatically downscale for non-retina devices.
The only exception is if you are doing manual, low level Core Graphics drawing.
You need to adjust the scale if so. 99.9% though, you don't have to worry about this.
From this post: Automatic resizing for 'non-retina' image versions
My question in regards to this is:
1. Should i do the testing on retina simulator only, as if i place a #2 grapic on
non-retina it will be too big? ...or is there an other way of doing it?
2. Should i always use a ImageView or is it OK to drag the image on the screen,
this is the logo i am talking about?
3. What about custom made buttons with images, how should i do with those?
4. What is the normal process to manage the different screen sizes, do people
add images for all displays or using this type of process?
Should i do the testing on retina simulator only, as if i place a #2 grapic on non-retina it will be too big? ...or is there an other
way of doing it?
It doesn't really matter which simulator you test on because as long as your non-retina and retina graphics are named correctly (image and image#2x) the correct image will be displayed automatically.
Should i always use a ImageView or is it OK to drag the image on the screen, this is the logo i am talking about?
When you drag and image from the project directly onto a view in interface builder you don't really see it happen but it has automatically created and image view which is containing the image your dropped in.
What about custom made buttons with images, how should i do with those?
[myButton setImage:[UIImage imageNamed:#"myFileName"]];
As shown in the above code you should always use the non-retina fle name when you reference the image a UI element should use. That was if iOS detects the device is retina it can automatically use the #2x version in its place.
What is the normal process to manage the different screen sizes, do people add images for all displays or using this type of process?
Yes, including multiple image resolutions common practice and is required for iPhone apps (not sure about iPad) to include both retina and non-retina images. But regardless of the requirements, you should definitely support both device resolutions to keep your customers happy!

Small icon app list view osx

In some applications like Sparrow Mail are set two different application icons. The default icon used in dock, in icon view e cover flow. Then a second smaller for list view, column view and title bar. How do you set the icon smaller? In file.plist there is only this.
Thanks.
Xcode includes the Icon Composer.app application which allows you to create .icns (Icon Suite) files which support multiple resolutions like shown in the following image:
As you can see in the image above, the Get Info panel’s “proxy” icon (in the titlebar) is using the small 16 x 16 icon, while the lower icon is using one of the larger sizes. If you are used to the single-size-only ways of UIImage, how an NSImage works in OS X may be confusing at first. In iOS, a UIImage represents a single bitmap image, and is basically a wrapper around a CoreGraphics CGImageRef. An NSImage in OS X works at a higher level, and as such, is quite different than a UIImage. An NSImage contains one or more specifically-sized NSImageReps, which are more analogous to a UIImage. In the screenshot you provided, both the window title bar button’s image and the NSImageView’s image are set to the same instance of an NSImage. When that image is asked to draw itself, however, the image is choosing 2 different NSImageReps based on the size requested. For more information on how this works, see Cocoa Drawing Guide: Image Basics - How an Image Representation is Chosen.
If you’re using the all-in-one Xcode.app app bundle, launch Xcode and choose Xcode > Open Developer Tool > Icon Composer. If you’re using the older style of the Xcode tools, with multiple folders, it’ll be at <Developer Tools>/Applications/Utilities/Icon Composer.app.