• 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
Rects and points...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Rects and points...


  • Subject: Rects and points...
  • From: Riccardo Santato <email@hidden>
  • Date: Tue, 20 Nov 2001 16:16:31 +0100

Hi there.
I'd reaally like someone of you help me in making this code work.
I'm just having fun with Bezier curves, but nothing is displayed... Can
you tell me please where are the errors ?
Many thanx to everyone 4 your kindness

- (IBAction)draw:(id)sender
{
// Point definitions
point_a = NSMakePoint(0.0, 0.0);
point_b = NSMakePoint(100.0, 100.0);
point_c = NSMakePoint(50.0,50.0);
NSLog (@"points: defined");

// Rectangle definition
view_rect = [self bounds];

// View allocation
[self initWithFrame:view_rect];

// Initializations

[self setNeedsDisplay:YES];
curve = [NSBezierPath bezierPathWithRect:view_rect];
[self convertPoint:point_a toView:self];
[self convertPoint:point_b toView:self];
[self convertPoint:point_c toView:self];
[[NSColor blackColor] set];
[curve moveToPoint:point_a];
[curve lineToPoint:point_b];
[curve lineToPoint:point_c];
[curve curveToPoint:point_a controlPoint1:point_b controlPoint2:point_c];
[self drawRect:view_rect];
[self displayRect:view_rect];
}

@end


--
Riccardo Santato
www.riccardosantato.com


  • Follow-Ups:
    • Re: Rects and points...
      • From: André Benassi <email@hidden>
    • Re: Rects and points...
      • From: Tom Waters <email@hidden>
    • Re: Rects and points...
      • From: "John C. Randolph" <email@hidden>
  • Prev by Date: Somewhat OT : PPD?
  • Next by Date: Example to send a Sleep AppleEvent from Cocoa ?
  • Previous by thread: Somewhat OT : PPD?
  • Next by thread: Re: Rects and points...
  • Index(es):
    • Date
    • Thread