• 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: NSRectFillListWithColors question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSRectFillListWithColors question


  • Subject: Re: NSRectFillListWithColors question
  • From: Heinrich Giesen <email@hidden>
  • Date: Wed, 14 May 2008 16:30:30 +0200


On 14.05.2008, at 15:32, Davide Scheriani wrote:

I was playing around with the Graphics drawing method
and I wanted to use NSRectFillListWithColors.
.....
My small problem is that it accept C-style arrays not NSArray.
What can I do?

Do exactly what the description of this function says;

void NSRectFillListWithColors(const NSRect *rects, NSColor **colors, int count)

I used this function to draw the colortables of GIF, PNG or BMP- imgaes and it looks something like:


    NSRect    rectList[256];  // long enough for a color table
    NSColor   *colorList[256];

    rectList[0] = NSMakeRect( 0,  0, 26, 16 );  // is it flipped ?
    rectList[1] = NSMakeRect( 32,  0, 26, 16 );
    rectList[2] = NSMakeRect( 64,  0, 26, 16 );

    colorList[0] = [NSColor blackColor];
    colorList[1] = [NSColor whiteColor];
    colorList[2] = [NSColor redColor];

    NSRectFillListWithColors( rectList, colorList, 3 );

Good luck
	Heinrich


-- Heinrich Giesen email@hidden


_______________________________________________

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


  • Follow-Ups:
    • Fwd: NSRectFillListWithColors question
      • From: Davide Scheriani <email@hidden>
  • Prev by Date: Cocoa and Carbon
  • Next by Date: Re: Create NSStrings from a mapped NSData object - safe?
  • Previous by thread: Re: NSRectFillListWithColors question
  • Next by thread: Fwd: NSRectFillListWithColors question
  • Index(es):
    • Date
    • Thread