Search Results

Search found 5 results on 1 pages for 'simplecode'.

Page 1/1 | 1 

  • Iphone SDK quesiton: How to make a Drawing method in a View class work using CGContextRef?

    - by SimpleCode
    I have these 2 methods in the View class. the drawRect method always gets called when the view is initalized. But i can't get the drawLine method to work. It doesn't do anything when it gets called. Am i supposed to deal with cgimagecontext or something like that? please help!! (void)drawRect:(CGRect)rect { // Drawing code // Drawing code CGContextRef contextRef = UIGraphicsGetCurrentContext(); //CGContextSetRGBFillColor(contextRef, 0, 0, 255, 1); CGContextSetRGBStrokeColor(contextRef, 0, 0, 0, 1); CGContextSetLineWidth(contextRef, 5.0); CGContextBeginPath(contextRef); CGContextMoveToPoint(contextRef, 0, 0); CGContextAddLineToPoint(contextRef, 320, 480); CGContextStrokePath(contextRef); } -(void)drawLine:(CGPoint)from to:(CGPoint) to { // Drawing code CGContextRef contextRef = UIGraphicsGetCurrentContext(); //CGContextSetRGBFillColor(contextRef, 0, 0, 255, 1); CGContextSetRGBStrokeColor(contextRef, 0, 128, 0, 1); CGContextSetLineWidth(contextRef, 5.0); CGContextBeginPath(contextRef); CGContextMoveToPoint(contextRef, 0, 0); CGContextAddLineToPoint(contextRef, 320, 50); CGContextStrokePath(contextRef); }

    Read the article

  • How to use AVAudioPlayer to play M4P

    - by SimpleCode
    I want to use AVAudioPlayer to play M4p files from iTunes generator. I could use uiWebView to play it and it worked, but I want to put an image of my choice on the background of the player instead of the "quick time" logo. Can you help me as how to do this? Here is an example of the m4p file I want to play with AVAudioPlayer. http://a801.phobos.apple.com/us/r1000/059/Music/b9/0d/be/mzi.zqnndbil.aac.p.m4p Seriously, big thanks in advance!!

    Read the article

1