Created
April 20, 2010 09:41
-
-
Save primalmotion/372243 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@implementation TNBase64Image : CPImage | |
{ | |
CPString baseEncoded64Data @accessors; | |
} | |
+ (TNBase64Image)base64ImageWithData:(CPString)someBase64Data | |
{ | |
var img = [[TNBase64Image alloc] init]; | |
[img setBaseEncoded64Data:someBase64Data]; | |
[img load]; | |
return img; | |
} | |
- (void)load | |
{ | |
if (_loadStatus == CPImageLoadStatusLoading || _loadStatus == CPImageLoadStatusCompleted) | |
return; | |
_loadStatus = CPImageLoadStatusLoading; | |
_image = new Image(); | |
_image.src = @"data:image/png;base64," + baseEncoded64Data; | |
console.log(_image.src); | |
[self _imageDidLoad]; | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment