I'm trying to implement dragging of a subclass of NSView, to copy an NSImage to 
the pasteboard so that it can be dragged into other applications (Pages, Mail, 
etc.). It works as expected until I resize the NSView's parent window (which 
resizes the NSView -- it always remains square). Once resized beyond a certain 
point, dragging the image produces a corrupt image.

A workaround was to use:
NSData *pdfData = [self dataWithPDFInsideRect:[self bounds]];
NSImage* image = [[NSImage alloc] initWithData:pdfData];

within the view, instead of NSBitmapImageRep. While my code works for my 
purposes, I'm still curious what I did wrong with NSBitmapImageRep such that it 
produces a corrupt image.

I asked the question on Stack Overflow. The (long) question, with image 
examples and the full code, is here:
http://stackoverflow.com/questions/13769849/nsview-image-corruption-when-dragging-from-scaled-view

If anybody has insight as to how to properly implement this with 
NSBitmapImageRep, I'd love to hear about what I'm doing wrong, either here or 
through Stack Overflow.

Thanks,
Clay
_______________________________________________

Cocoa-dev mailing list ([email protected])

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to