2010. 11. 16. 13:46
[Dev/iOS]
//Converting UIImage to NSData
UIImage *image = [UIImage imageNamed: @"canning.png"];
NSData *imageData = UIImagePNGRepresentation(image);
//Converting NSData to Byte array
NSUInteger len = [imageData length];
Byte *byteData = (Byte*)malloc(len);
memcpy(byteData, [imageData bytes], len);
UIImage *image = [UIImage imageNamed: @"canning.png"];
NSData *imageData = UIImagePNGRepresentation(image);
//Converting NSData to Byte array
NSUInteger len = [imageData length];
Byte *byteData = (Byte*)malloc(len);
memcpy(byteData, [imageData bytes], len);
'Dev > iOS' 카테고리의 다른 글
objective C category 내 동일한 함수들 (0) | 2010.12.22 |
---|---|
xcode weak framework (0) | 2010.12.22 |
Uninstalling Xcode Developer Tools (0) | 2010.12.21 |
Base SDK Missing (0) | 2010.09.09 |
Couldn't register ** with the bootstrap server. Error: unknown error code. (0) | 2010.09.07 |