Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

santoshgornal

macrumors newbie
Original poster
May 22, 2008
10
0
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
 

Bakerman

macrumors member
Jan 31, 2005
62
7
Sweden
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.
 

santoshgornal

macrumors newbie
Original poster
May 22, 2008
10
0
Bezier curves,rectangle,Curves

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.

hi

ihave tried these things, but i am not getting please can u provide me working code for cococa touch
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.