• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Dragging Image
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Dragging Image


  • Subject: Dragging Image
  • From: Herr Witten <email@hidden>
  • Date: Sat, 31 Jan 2004 22:48:58 -0500

I have an NSTableView subclass that overrides the dragging image:

- (NSImage *)dragImageForRows:(NSArray *)dragRows event:(NSEvent
*)dragEvent dragImageOffset:(NSPointPointer)dragImageOffset
{
NSImage* image = [super dragImageForRows: dragRows event: dragEvent
dragImageOffset: dragImageOffset];

NSImage* imageProper = [[NSImage alloc] initWithSize: [image size]];

[imageProper lockFocus];
[[[NSColor selectedControlColor] colorWithAlphaComponent: 0.5]
set];
NSRect fillRect = NSMakeRect(0, 0, 0, 0);
fillRect.size = [imageProper size];
[NSBezierPath fillRect: fillRect];
[image dissolveToPoint: NSMakePoint(0, 0) fraction: 1.0];
[imageProper unlockFocus];

return imageProper;
}

The result is a translucent blue rectangle with black text.

How do I invert the text to make it white? Thanks.

Herr Witten
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Prev by Date: Re: NOT related to Cocoa (Sorry) - ANSWER
  • Next by Date: Re: NOT related to Cocoa (Sorry) - Humorous
  • Previous by thread: Recommendations for storing text messages in data files
  • Next by thread: Invoking a Callback Selector (Newbie question)
  • Index(es):
    • Date
    • Thread