• 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
Re: Why does this code not create a colored dot?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
References: 
 >Why does this code not create a colored dot? (From: desktoast music productions <email@hidden>)

  • Prev by Date: Why does this code not create a colored dot?
  • Next by Date: Re: Why does this code not create a colored dot?
  • Previous by thread: Why does this code not create a colored dot?
  • Next by thread: Re: Why does this code not create a colored dot?
  • Index(es):
    • Date
    • Thread