cgpath - Swift - drawing lines from one point to another -
What is the best way to attract points from one point to another? I want to draw a line which is the most effective way at the next point should I use NSBezierPath?
How do I start or start learning about it?
Sebastian is completely correct on this; Do not need to do it more difficult than to add some more details, the following code pulls a box around the window:
CGColorSpaceRef rgbColorspace = CGColorSpaceCreateDeviceRGB (); CGContextRef Reference = [[NSGraphicsContext PresentContacts] Graphicsport]; NSRNCT NSBound = [Self limit]; // CIGTT CGBOUND = Get the limits of NSFTOCOCrite (NSBound); // Set graphics boundaries // ********************************************************************************************** ***************************** Window in the gray box **************************************************************************************************** ********************************* CGContextMoveToPoint (Reference, 0.0.1.0) ); CGContextAddLineToPoint (Reference, 0.0, cgBounds.size.height - 1.0); CGContextAddLineToPoint (Reference, cgBounds.size.width - 2.0, cgBounds.size.height - 1.0); CGContextAddLineToPoint (Reference, cgBounds.size.width - 2.0, 1.0); CGContextAddLineToPoint (Reference, 0.0, 1.0); CGContextSetLineWidth (Reference, 2.0); CGContextSetRGBStrokeColor (Reference, 0.7, 0.7, 0.7, 1.0); CGContextStrokePath (reference);
Comments
Post a Comment