[Bf-committers] Accessing UV/Image Editor Image Data

patrick boelens p_boelens at msn.com
Wed Sep 19 17:04:56 CEST 2012


Hey all,

I've recently been working on something that required me to do a lot of side-by-side comparisons of render results with existing images. Getting frustrated with having to save the result, open it in Pixelmator, making adjustments and repeating, I figured I'd code in a quick "copy to clipboard" operator.
I extended the putClipboard() function and everything is in place except for one little thing, accessing the active image data in a "pasteboard-ready" format.
I'm on OSX, so I'm working on the GHOST_SystemCocoa implementation. What I need is to get the image data ready to be put in an NSData object. A workaround would be to save the image to /tmp and then use 


dataToCopy = [NSData dataWithContentsOfFile:@"/tmp/untitled.png"];
but I'm wondering if there's a more immediate way of going about this? Any help would be greatly appreciated. =)

Thanks,
Patrick
 		 	   		  


More information about the Bf-committers mailing list