Non-rectangular image of NSView for dragging
Non-rectangular image of NSView for dragging
- Subject: Non-rectangular image of NSView for dragging
- From: Martin Hewitson <email@hidden>
- Date: Sun, 19 Jun 2011 15:46:02 +0200
Dear list,
I have a view which contains a set of subviews. This control is a little like a collection view. I have drag-n-drop implemented but I'm having some trouble getting a decent image for dragging. The problem is that the subviews are not rectangular but have rounded corners. So far I'm using NSBitmapImageRep's -initWithFocusedViewRect to grab a screen-shot of the correct part of the screen. Unfortunately I can only specify the portion of the screen to grab using an NSRect. This results in the background of the main view being included in the dragging image. This looks kind of ugly. What I'd really like is to do the same but specify a bezier path instead. I was wondering if there is a better way to generate a drag image which properly reflects what the subview actually draws.
Best wishes,
Martin
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Martin Hewitson
Albert-Einstein-Institut
Max-Planck-Institut fuer
Gravitationsphysik und Universitaet Hannover
Callinstr. 38, 30167 Hannover, Germany
Tel: +49-511-762-17121, Fax: +49-511-762-5861
E-Mail: email@hidden
WWW: http://www.aei.mpg.de/~hewitson
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden