Skip to content

Instantly share code, notes, and snippets.

@zonble
Created February 2, 2010 10:11
Show Gist options
  • Save zonble/292559 to your computer and use it in GitHub Desktop.
Save zonble/292559 to your computer and use it in GitHub Desktop.
在 iPhone 上產生一個新的 image context 並且產生 UIImage
// 每次都忘記要這樣開頭…
UIGraphicsBeginImageContext(CGSizeMake(320.0, 320.0));
CGContextRef context = UIGraphicsGetCurrentContext();
defaultCoverImage = [UIGraphicsGetImageFromCurrentImageContext() retain];
UIGraphicsEndImageContext();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment