1. Welcome to the new MacRumors forums. See our announcement and read our FAQ

Drawing Bezier curve,rectangle,Text

Discussion in 'iPhone/iPad Programming' started by santoshgornal, Feb 25, 2009.

  1. macrumors newbie

    #1
    Hi ALL,

    In my application i want to draw Bezier curves which includes Drawing rectangle,Square,and text
    i am using view Based template in iphone application please can any body provide details regarding this, i have used code

    CGRect rect =CGRectMake(10,20,300,300);
    CGContextRef ctx = UIGraphicsGetCurrentContext();
    CGContextClearRect(ctx, rect);
    CGContextSetRGBFillColor(ctx, 255, 0, 0, 1);
    CGContextFillRect(ctx, CGRectMake(10, 10, 50, 50));
    CGContextSetRGBFillColor(ctx, 0, 255, 0, 1);
    CGContextFillEllipseInRect(ctx, CGRectMake(100, 100, 25, 25));

    but its not drawing any thing on the screen, please any body provide tutorials from scratch to creat graphics.

    thanks
    santosh
     
  2. macrumors member

    #2
    At a glance I'm noticing that your arguments to CGContextSetRGBFillColor are off; this function accepts floating point numbers between 0.0 and 1.0.
     
  3. Moderator emeritus

    kainjow

    #3
    Also make sure you're putting this code in the drawRect: method.
     
  4. macrumors newbie

    #4
    Bezier curves,rectangle,Curves

    hi

    ihave tried these things, but i am not getting please can u provide me working code for cococa touch
     
  5. Moderator

    dejo

    Staff Member

    #5
    I'd suggest looking at the Quartz Demo sample app.
     

Share This Page