Skip to content

Instantly share code, notes, and snippets.

@hetima
Created October 17, 2013 16:44
Show Gist options
  • Select an option

  • Save hetima/7028237 to your computer and use it in GitHub Desktop.

Select an option

Save hetima/7028237 to your computer and use it in GitHub Desktop.
NSImage* lightImage;
{
lightImage=[[NSImage alloc]initWithSize:[image size]];
[lightImage lockFocus];
NSRect rect=NSZeroRect;
rect.size=[image size];
[image drawAtPoint:NSZeroPoint fromRect:rect operation:NSCompositeCopy fraction:0.4];
[lightImage unlockFocus];
}
NSImage* lightImage=({
NSImage* lightImage=[[NSImage alloc]initWithSize:[image size]];
[lightImage lockFocus];
NSRect rect=NSZeroRect;
rect.size=[image size];
[image drawAtPoint:NSZeroPoint fromRect:rect operation:NSCompositeCopy fraction:0.4];
[lightImage unlockFocus];
lightImage;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment