objective c - Changing OS X desktop background image scaling mode -


i've been working on project changes desktop image, i've been accomplishing so:

[[nsworkspace sharedworkspace] setdesktopimageurl:fileurl forscreen:[nsscreen mainscreen] options:[nsdictionary dictionary] error:&error]; 

this works, gives me no control on scaling. i'd able choose scaling options programatically can in ui (fill screen, fit screen, stretch fill screen, center, tile), can find no documentation explaining how so. worse that, calling above method resets scaling "fill screen".

any assistance appreciated. time , help!

you can set nsworkspacedesktopimagescalingkey in option parameter. here's possible values:

nsimagescaleproportionallydown

if large destination, scale image down while preserving aspect ratio.

nsimagescaleaxesindependently

scale each dimension fit destination. setting not preserve aspect ratio of image.

nsimagescalenone

do not scale image.

nsimagescaleproportionallyupordown

scale image maximum possible dimensions while both staying within destination area , preserving aspect ratio.

declared in nscell.h.


Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -