I would like to retrieve iphone wallpaper system setting and display the system wallpaper into my iphone app as background image. Is it possible or sample code? Thanks in advance.
+1
A:
AFAIK there are no documented procedures to get the wallpaper image, but you may use these undocumented methods (usual warnings apply):
+[UIImage defaultDesktopImage]
.- Read the image at
/var/mobile/Library/LockBackground.jpg
.
KennyTM
2010-02-18 09:02:52
The second method will only work on a jailbroken iPhone
Petesh
2010-02-18 09:10:34
@Petesh: Not really, you can access it indirectly by symlink-ing to it.
KennyTM
2010-02-18 09:34:01
@KennyTM I did not know that. Consider me educated... goes off and writes test application...
Petesh
2010-02-18 09:54:12
@KennyTM I get a NULL file when I try to access the lock background image via a symlink. defaultDesktopImage returns the globe image, not the current desktop image.
Petesh
2010-02-18 14:16:35
@Petesh: Hm maybe the sandbox is tightened.
KennyTM
2010-02-18 14:27:26
A:
Thanks a lot, Kenny. Those two approaches can not work properly.
1.[UIImage defaultDesktopImage] can only return the fixed image which is always "Earth" image. If I select other image in the wallpaper folder, it still returns the "Earth" image.
- I use UIImage imageWithContentsOfFile method to load @"/var/mobile/Library/LockBackground.jpg" or @"/User/Library/LockBackground.jpg" or @"/User/Library/LockBackground.png" The image is always nil.
Do you know why? Thanks again.
onetoonehundred
2010-02-22 15:17:54