Re: Why does this code not create a colored dot?
Re: Why does this code not create a colored dot?
- Subject: Re: Why does this code not create a colored dot?
- From: Alexander Spohr <email@hidden>
- Date: Tue, 4 Apr 2006 15:09:49 +0200
Am 04.04.2006 um 15:08 schrieb desktoast music productions:
I tried to resolve my problem like that:
- (NSImage *)createImageWithColor:(NSColor *)color {
NSRect frame = NSMakeRect(0, 0, 11, 11);
NSView *imageView = [[NSView alloc] initWithFrame:frame];
NSBezierPath *path = [NSBezierPath
bezierPathWithOvalInRect:frame];
[color set]; //???
[path fill];
NSData *imageData = [imageView dataWithPDFInsideRect:frame];
NSImage *resultImage = [[NSImage alloc] initWithData:imageData];
return resultImage;
}
Why does this code not return a colored dot? Can it? What am I
doing wrong?
you don’t lockFocus onto the view.
and besides, just draw into the NSImage, forget the NSView...
atze
_______________________________________________
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