objective c - How to show in-memory NSImage as Retina (@2x)? -
I am showing dynamic-loaded images like under the image in I am loading and resizing as the image: The However I have to show these images in 48x48 in the same points of view. Showing this as @ 2x I can not find a way to use the If I use 48x48 image in the Any ideas how can I get memory images in NSMenuItem without a file? Just it should be enough to If this does not work, you can make the image "manually", starting with the desired size, with the available description representing the bitmap image, the size of the delegation and the pixel dimension ( Separate), and add that representation to the image. NSMenuItem s.
[menuItem setImage: [self process image: [[NSImage alloc] url] ]]; [Add MenuEystem: MenuEmix];
process image function changes 88x88 px size. The image is displayed on 24x24 px (shown below) because it does not look like a retina pictures but if I put it at 48x48px it is not shown as small as 24x24, so NSMenuItem does not actually resizing.
[NSMenuItem setImage:] method or save the file of
NSImage without the 48x48 file and the file Name ending
@ 2x .
setImage: method, then the height of the NSMINIT is only twice as large and it actually indicates 48 digits * 48 digits.
[image set size: NSMakeSize (24, 24)] < / Code> is more pixels than that image
-setSize: sets its logical size in the digits The given representation in the image determines how many pixels it has if the pixel amplitude is greater than the point dimensions , Then there is more detail. This extension can be used if the drawing destination is also high-resolution.
Comments
Post a Comment