Not sure if this is a bug or not, but it's certainly something that seems to 
have changed and I can find no mention of it in the release notes or elsewhere.

Typically when making an image for use as a drag image, I draw a bunch of 
things into an image, then copy it to itself with 50% alpha. This has always 
worked fine, using the following general approach:

NSImage* image = [[NSImage alloc] initWithSize:]

[image lockFocus];

// ... draw a bunch of stuff ...

// copy to self at 50% opacity
[image drawAtPoint:NSZeroPoint fromRect:NSZeroRect operation:NSCompositeCopy 
fraction:0.5];
[image unlockFocus];


I'm now finding that I don't get the semi-transparent image, but just a fully 
opaque image. I can workaround it like so:

NSImage* image = [[NSImage alloc] initWithSize:]

[image lockFocus];

// ... draw a bunch of stuff ...

[image unlockFocus];

[image lockFocus];
[image drawAtPoint:NSZeroPoint fromRect:NSZeroRect operation:NSCompositeCopy 
fraction:0.5];
[image unlockFocus];


So the extra unlock/lock seems to trigger some internal change that allows the 
transparent effect to work, but that wasn't needed in the past.

Anyone care to comment? Maybe the old way was always broken and it worked by 
chance, or maybe a change to image functionality didn't anticipate this usage 
pattern...

--Graham


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to