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

Re: Pie shapes


  • Subject: Re: Pie shapes
  • From: Henry McGilton <email@hidden>
  • Date: Thu, 19 May 2005 10:46:35 -0700


On May 19, 2005, at 10:06 AM, R T wrote:

The answer to the Piece-of-Pie shape is  ...
moveToPoint:aPt... which locates/anchors the path.
Then to be able to draw in different colors, I need
...removeAllPoints and  ... moveToPoint:aPt  at the
end of each loop to avoid getting all the Pie shapes
in the color that was defined last in the loop.

        float st = 1,  num = 0, rr, gg, bb, y = 200,
ct = 0;
        NSPoint aPt = {223, 223};
        NSBezierPath *bp = [NSBezierPath bezierPath];

        [bp moveToPoint:aPt];
        do{
                rr = num/255;  gg = num/255;  bb =
num/255;
                [[NSColor colorWithCalibratedRed:rr
green:gg blue:bb
alpha:1.0] set];
                [bp
appendBezierPathWithArcWithCenter:aPt radius:y
startAngle:108 endAngle:114];
                [bp closePath];
                [bp fill];      [bp removeAllPoints];
 [bp
moveToPoint:aPt];

                st++;   y -= 10;        ct += 16;
        }while(ct<256);


...here's to all us newbies whose questions don't always raise the interest of this brain trust.

Well, that might be because the members of the brain trust can't figure out what you are really trying to do.

The above code simply draws a six-degree black filled wedge.

You initialise the variable  num  to 0 and then divide it
repeatedly by 255, which comes out to zero, and you never
do anything subsequently to change  num  in any way.

Similarly, the variable  st  is initialised to 1 and then
repeatedly incremented, but never apparently used for any
purpose.

So, what are you *really* trying to accomplish?

    Cheers,
		........  Henry



===============================+============================
  Henry McGilton, Boulevardier |    Trilithon Software
   Objective-C/Java Composer   |     Seroia Research
-------------------------------+----------------------------
  mailto:email@hidden   |   http://www.trilithon.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


References: 
 >Re: Pie shapes (From: R T <email@hidden>)

  • Prev by Date: Re: Accessing MP3 and AAC album art
  • Next by Date: Re: CoreData & Relationship binding not sending updates?
  • Previous by thread: Re: Pie shapes
  • Next by thread: Re: Pie shapes
  • Index(es):
    • Date
    • Thread