-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathOSWallpaperView.m
43 lines (23 loc) · 881 Bytes
/
OSWallpaperView.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#import "OSWallpaperView.h"
@implementation OSWallpaperView
+(UIImage*)wallpaperImage{
static UIImage *image;
if(image == nil){
//NSData *wallpaperFile = [NSData dataWithContentsOfFile:@"/var/mobile/Library/SpringBoard/LockBackground.cpbitmap"];
//CGImageRef wallpaper = CGImageFromCPBitmap((unsigned char*)[wallpaperFile bytes], [wallpaperFile length]);
//image = [UIImage imageWithCGImage:wallpaper];
//CFRelease(wallpaper);
}
return image;
}
-(id)init{
if(![super initWithFrame:[[UIScreen mainScreen] bounds]]){
return nil;
}
[self setImage:[OSWallpaperView wallpaperImage]];
self.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
self.backgroundColor = [UIColor blackColor];
self.contentMode = UIViewContentModeScaleAspectFill;
return self;
}
@end