Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jberlana/JBKenBurns
Ken Burns effect for iOS. The feature enables a widely used technique of embedding still photographs in motion pictures, displayed with slow zooming and panning effects, and fading transitions between frames.
https://github.com/jberlana/JBKenBurns
Last synced: about 2 months ago
JSON representation
Ken Burns effect for iOS. The feature enables a widely used technique of embedding still photographs in motion pictures, displayed with slow zooming and panning effects, and fading transitions between frames.
- Host: GitHub
- URL: https://github.com/jberlana/JBKenBurns
- Owner: jberlana
- License: other
- Created: 2011-09-27T09:20:39.000Z (over 13 years ago)
- Default Branch: master
- Last Pushed: 2017-04-20T10:03:02.000Z (almost 8 years ago)
- Last Synced: 2024-10-31T16:09:48.959Z (3 months ago)
- Language: Objective-C
- Homepage:
- Size: 18.4 MB
- Stars: 542
- Watchers: 25
- Forks: 120
- Open Issues: 12
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome - JBKenBurns - Ken Burns effect for iOS. The feature enables a widely used technique of embedding still photographs in motion pictures, displayed with slow zooming and panning effects, and fading transitions between frames. (etc)
- awesome - JBKenBurns - Ken Burns effect for iOS. The feature enables a widely used technique of embedding still photographs in motion pictures, displayed with slow zooming and panning effects, and fading transitions between frames. (etc)
README
iOS Ken Burns effect
====================**The goal of this project is to create a `UIView` that can generate a Ken Burns transition when given an array of `UIImage` objects.**
![image]()
To use it, you simply need an instance of `JBKenBurnsView` and call this method to start the action:
``` objc
[self.kenView animateWithImages:myImages
transitionDuration:6
initialDelay:0
loop:YES
isLandscape:YES];
```## Installation
I recommend use [CocoaPods](http://cocoapods.org) to install JBKenBurnsView. Simply add the following line to your `Podfile`:
#### Podfile
```ruby
pod 'JBKenBurnsView'
```But you can also just drop `JBKenBurnsView.m` and `JBKenBurnsView.h` in your project.
## Documentation
The project is documented using AppleDocs syntax. But this is a summary:
#### Start the slideshow
You can start an animation using an `NSArray` of `UIImage` or `NSString` with the paths to the images calling:``` objc
- (void)animateWithImages:(NSArray *)images
transitionDuration:(float)time
initialDelay:(float)delay
loop:(BOOL)isLoop
isLandscape:(BOOL)isLandscape;
```
or``` objc
- (void)animateWithImagePaths:(NSArray *)imagePaths
transitionDuration:(float)time
initialDelay:(float)delay
loop:(BOOL)isLoop
isLandscape:(BOOL)isLandscape;
```1. `images:` NSArray of UIImages.
2. `time:` Time in seconds for the transition between images.
3. `delay:` Time in seconds until the transition should start.
4. `isLoop:` YES if the animation should start again when ended.
5. `isLandscape:` If YES optimized to show in Landscape mode.#### Stop the animation
When the transition has started you can stop the animation calling:`- (void)stopAnimation;`
#### Add new images to the animation
Or add new images to the array of images in the slide show with:`- (void)addImage:(UIImage *)image;`
#### KenBurnsViewDelegate
There is a protocol that notifies to the delegate when an image changes or the slideshow ended.``` objc
@protocol KenBurnsViewDelegate@optional
- (void)kenBurns:(JBKenBurnsView *)kenBurns didShowImage:(UIImage *)image atIndex:(NSUInteger)index;
- (void)kenBurns:(JBKenBurnsView *)kenBurns didFinishAllImages:(NSArray *)images;@end
```## TODO
* Need to allow device rotation.
* Improvements on image transition effects.## Demo
Build and run the `KenBurnsDemo` project in Xcode to see `JBKenBurnsView` in action.
## Swift version
[@gatada](https://github.com/gatada) wrote a Swift version of `JBKenBurnsView` that you can find [here](https://github.com/Gatada/JBKenBurnsView).
## Communication
- If you **found a bug**, open an issue.
- If you **have a feature request**, open an issue.
- If you **want to contribute**, submit a pull request.Thanks a lot to all the people that have collaborated on this library:
- Peter Steinberger [@steipete](https://github.com/steipete)
- Orta [@orta](https://github.com/orta)
- Almas Adilbek [@mixdesign](https://github.com/mixdesign)
- Boska [@boska](https://github.com/boska)
- Alec Gorge [@alecgorge](https://github.com/alecgorge)
- [@scgpilot](https://github.com/scgpilot)
- [@michaelcho](https://github.com/michaelcho)
- [@mystersu](https://github.com/mystersu)## Contact
Javier Berlana
- http://github.com/jberlana
- http://twitter.com/jberlana
- [email protected]## License
JBKenBurnsView is available under the MIT license. See the LICENSE file for more info.
--
###[SweetBits](http://www.sweetbits.es/ "SweetBits"), welcome to the candy factory.###