Re: NSImage setBackgroundColor: w|o any effect [SOLVED]
Re: NSImage setBackgroundColor: w|o any effect [SOLVED]
- Subject: Re: NSImage setBackgroundColor: w|o any effect [SOLVED]
- From: desktoast music productions <email@hidden>
- Date: Wed, 19 Apr 2006 10:07:28 +0200
> What is the data type of the image?
I didn't even know then. What I really wanted to change, was the background
of the dragImage returned by
- (NSImage *)dragImageForRows:(NSArray *)dragRows event:(NSEvent *)dragEvent
dragImageOffset:(NSPointPointer)dragImageOffset;
I didn't receive any answers on this. So I put my question more precisely -
in a different thread (Adjusting appearance of dragImage).
The problem finally was solved exactly like you stated:
- (NSImage *)dragImageForRows:(NSArray *)dragRows event:(NSEvent *)dragEvent
dragImageOffset:(NSPointPointer)dragImageOffset {
NSImage *inImage;
NSImage *outImage;
NSSize s;
NSRect imageBounds;
NSColor *transBG = [[NSColor keyboardFocusIndicatorColor]
colorWithAlphaComponent:0.25];
inImage = [super dragImageForRows:dragRows event:dragEvent
dragImageOffset:dragImageOffset];
s = [inImage size];
imageBounds.origin = NSMakePoint(0,0);
imageBounds.size = s;
outImage = [[NSImage alloc] initWithSize:s];
[outImage lockFocus];
[transBG set];
[NSBezierPath fillRect:imageBounds];
[inImage dissolveToPoint:(imageBounds.origin) fraction:1.0];
[outImage unlockFocus];
return outImage;
}
Looks nice.
Peter
--
peter schwaiger
desktoast music productions
http://www.autlawmusic.com
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden