Skip to content

Instantly share code, notes, and snippets.

@joelreymont
Created December 31, 2009 16:38
Show Gist options
  • Save joelreymont/266793 to your computer and use it in GitHub Desktop.
Save joelreymont/266793 to your computer and use it in GitHub Desktop.
;; retrieve raw image data
(multiple-value-bind (background-bitmap background-data)
(cocoa-get-image-bytes ns-background)
(multiple-value-bind (image-bitmap image-data)
(cocoa-get-image-bytes ns-image)
(multiple-value-bind (mask-bitmap mask-data)
(cocoa-get-image-bytes ns-mask)
(cocoa-blend background-data
image-data
mask-data
offset size)
(objc:invoke ns-background
"removeRepresentation:"
(objc:invoke
(objc:invoke ns-background "representations")
"objectAtIndex:" 0))
(objc:invoke ns-background
"addRepresentation:"
background-bitmap)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment