Search Results

Search found 8 results on 1 pages for 'user157733'.

Page 1/1 | 1 

  • UIGraphicsGetImageFromCurrentImageContext gives poor quality / low resolution image, how do I get be

    - by user157733
    Ok so I am taking a screen shot of a photo I took with my camera on the iPhone. I put the camera photo into UIImageView and grab a screenshot of it using this sort of code (this is from http://www.skylarcantu.com/blog/2009/10/16/saving-a-view-as-an-image/)... - (void)takeScreenshot { UIWindow *theScreen = [[UIApplication sharedApplication].windows objectAtIndex:0]; UIGraphicsBeginImageContext(theScreen.frame.size); [[theScreen layer] renderInContext:UIGraphicsGetCurrentContext()]; UIImage *screenshot = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); [self doSomethingWith:screenshot]; } I have it working as I want but the image quality of the screenshot is much worse than the image I take with my camera. Is there a way to overcome this? I guess it is because this takes a screenshot which captures the resolution of the iPhone screen rather than the resolution of the camera - maybe?! Any suggestions would be great :-)

    Read the article

  • Animation on the iPhone - use image sequence or rotation?

    - by user157733
    I am creating a basic animation for my iPhone app. I have a choice to make between 2 different types of animation. I can use this... NSArray *myImages = [NSArray arrayWithObjects: [UIImage imageNamed:@"myImage1.png"], [UIImage imageNamed:@"myImage2.png"], [UIImage imageNamed:@"myImage3.png"], [UIImage imageNamed:@"myImage4.gif"], nil]; UIImageView *myAnimatedView = [UIImageView alloc]; [myAnimatedView initWithFrame:[self bounds]]; myAnimatedView.animationImages = myImages; myAnimatedView.animationDuration = 0.25; [self addSubview:myAnimatedView]; [myAnimatedView release]; or something like this... [UIView beginAnimations:nil context:NULL]; [UIView setAnimationDuration:1.5]; // other animations goes here myImage.transform = CGAffineTransformMakeRotation(M_PI*0.5); // other animations goes here [UIView commitAnimations]; I have quite a few of these parts to animate so I want to choose an option which uses the least amount of memory and runds the quickest. Any advice would be great, thanks

    Read the article

  • iPhone app memory leak with UIImage animation? Problem testing on device

    - by user157733
    I have an animation which works fine in the simulator but crashes on the device. I am getting the following error... Program received signal: “0”. The Debugger has exited due to signal 10 (SIGBUS) A bit of investigating suggests that the UIImages are not getting released and I have a memory leak. I am new to this so can someone tell me if this is the likely cause? If you could also tell me how to solve it then that would be amazing. The images are 480px x 480px and about 25kb each. My code is below... NSArray *rainImages = [NSArray arrayWithObjects: [UIImage imageNamed:@"rain-loop0001.png"], [UIImage imageNamed:@"rain-loop0002.png"], [UIImage imageNamed:@"rain-loop0003.png"], [UIImage imageNamed:@"rain-loop0004.png"], [UIImage imageNamed:@"rain-loop0005.png"], [UIImage imageNamed:@"rain-loop0006.png"], //more looping images [UIImage imageNamed:@"rain-loop0045.png"], [UIImage imageNamed:@"rain-loop0046.png"], [UIImage imageNamed:@"rain-loop0047.png"], [UIImage imageNamed:@"rain-loop0048.png"], [UIImage imageNamed:@"rain-loop0049.png"], [UIImage imageNamed:@"rain-loop0050.png"], nil]; rainImage.animationImages = rainImages; rainImage.animationDuration = 4.15/2; rainImage.animationRepeatCount = 0; [rainImage startAnimating]; [rainImage release]; Thanks

    Read the article

  • Understanding CABasicAnimation when spinning an object from a random angle....

    - by user157733
    I have spent ages trying to figure this out and I am still having problems. I want to rotate an image a random number of time - say 5 and a bit - then have it stop. I then want to rotate it again FROM ITS STOPPED POSITION. I am having difficulty with this so maybe someone can advise me on the right way to do it. Ok so I am using a CABasicAnimation for the spin like this... CABasicAnimation* rotationAnimation; rotationAnimation = [NSNumber numberWithFloat: 0.0]; rotationAnimation.toValue = [NSNumber numberWithFloat: M_PI * 1.0]; rotationAnimation.duration = 100; rotationAnimation.cumulative = YES; rotationAnimation.repeatCount = 5.2; rotationAnimation.removedOnCompletion = NO; rotationAnimation.fillMode = kCAFillModeForwards; [myView.layer addAnimation:rotationAnimation forKey:@"rotationAnimation"]; This works fine. I use a animationDidStop function to transform the image to the new angle so that it actually in the new position (not just appearing that way). This is where my problems start. I have tried the following... removing the toValue line which means the animation starts from where it currently is but when the animation block is repeated it jumps back to this start position every time the block is run storing the value of the end rotation and using this in the toValue so the 2 lines of code become... rotationAnimation = [NSNumber numberWithFloat: previousVal]; rotationAnimation.toValue = [NSNumber numberWithFloat: (M_PI * 1.0)+previousVal]; when I do this the animation still jumps because it is flicking back to the previousVal everytime the block is repeated Therefore my final thought is to check to see if the image is at zero, if not then rotate it to zero, then impliment the block of code to spin multiple times. This seems complicated but is this the ONLY way to achieve this? I am concerned about getting the timings smooth with this method. Any suggestions would be amazing! Thanks

    Read the article

  • Save a camera photo with an overlayed image - iphone SDK

    - by user157733
    I think this should be simple but I am having some difficulty implementing it. I take a photo from the camera, the user can then move and scale it. They then choose "use" and they get a preview of their image. Now what I want to do is overlay an image on top of this preview image - which is also ok. But the part I am having difficulty is then I want to save the photo taken WITH the image that is over it into the library. I just have a UIView with my overlay image about the UIView where my camera photo is previewed. I guess I just need to take a screen capture of these? I don't want to loose resolution OR end up with my UI buttons etc in the final image. Any suggestions or links would be really useful. Thanks :-)

    Read the article

  • Free iPhone weather API for the UK?

    - by user157733
    I am wanting to create a very simple weather app which only gives the current weather but in the UK. I have done a bit of searching but have yet to find a free API that I can use which works specifically for the UK. Does anyone have any experience of this or any suggestions?

    Read the article

  • wav stopped working with AudioServices on my iPhone app?

    - by user157733
    I have a wav file that was working fine. It is played using the AudioServices methods. Suddenly it stopped working. The weird thing is if i change he wav file to a different one that works. Any idea what is going on? The non working sound is slightly longer (still <10seconds) but it was originally working so I just can't figure it out. Any suggestions of what to try would be most appreciated. Thanks :-)

    Read the article

  • iPhone app getting XML then refreshing it at intervals...

    - by user157733
    I have an app which gets some data from the web via an XML document. I have this working fine and have followed apples SeismicXML example (uses NSURLRequest etc). I am very new to this so I have to admit that I do not totally understand all the code that gets the XML - but it is working. My problem is that my app may be running for some time so I want to be able to refresh the XML every now and again and check to see if it is different. If it is different I need to update my contents. Basically this means my questions are.... Is there a standard way of doing this? I was thinking of creating a timer to call the function which parses the XML but I can't figure out which function to call. If anyone can give me any pointers or even better examples of this it would be fab. Thanks

    Read the article

1