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

Fwd: NSRectFillListWithColors question


  • Subject: Fwd: NSRectFillListWithColors question
  • From: Davide Scheriani <email@hidden>
  • Date: Wed, 14 May 2008 19:19:09 +0200

okkei,good,this is working,but I wanted to use NSArray instead a simple C-style array.
In many case I have NSArray it hold NSValue for each NSRect.




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 );
_______________________________________________

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:
    • Re: NSRectFillListWithColors question
      • From: Nick Zitzmann <email@hidden>
References: 
 >Re: NSRectFillListWithColors question (From: Heinrich Giesen <email@hidden>)

  • Prev by Date: Re: Can I use NSString classes SYNCHRONOUSLY?
  • Next by Date: Re: Bypassing Interface Builder
  • Previous by thread: Re: NSRectFillListWithColors question
  • Next by thread: Re: NSRectFillListWithColors question
  • Index(es):
    • Date
    • Thread