How can I be so wrong about graphics?
How can I be so wrong about graphics?
- Subject: How can I be so wrong about graphics?
- From: Development <email@hidden>
- Date: Mon, 06 Jun 2011 14:31:28 -0700
I'm really loosing faith in my ability to read simple english
According to like a million examples... If I place the follow bit of code in a view's drawRect: method I should get a line from pointA to pointB however I get nothing.
How can subclassing UIView be this difficult? I have turned off clips to bounds, set the stroke color to black and done basically everything I know to do but I get an empty path
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextSetStrokeColorWithColor(context, self.strokeColor.CGColor);
CGContextBeginPath(context);//According to most examples this is a waste of code
// Draw them with a 2.0 stroke width so they are a bit more visible.
CGContextSetLineWidth(context, 2.0);
CGContextMoveToPoint(context, pointA.x,pointA.y); //start at this point
CGContextAddLineToPoint(context,pointB.x, pointB.y); //draw to this point
// and now draw the Path!
CGContextStrokePath(context);
_______________________________________________
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