frosty / flipbook Goto Github PK
View Code? Open in Web Editor NEWA Swift tool to render UIViews to image sequences for use with WatchKit, and accompanying sample WatchKit project.
A Swift tool to render UIViews to image sequences for use with WatchKit, and accompanying sample WatchKit project.
It was no problem doing this myself in my own local copy, though would be annoying to keep doing it with no projects.
I expect a lot of people will be interested in this, so I'm putting up my example code. This uses core image to rotate the image inside an imageview and records the rotation into a animation.
This is because I couldn't get a transform to work on my snapshots how I would normally do it:
let number = CGFloat(-1.01 * M_PI)
let rotationTransform = CATransform3DMakeRotation(number, 0, 0, 1)
let rotationAnimation = CABasicAnimation(keyPath: "transform")
rotationAnimation.toValue = NSValue(CATransform3D: rotationTransform);
rotationAnimation.duration = 0.4
rotationAnimation.cumulative = true
rotationAnimation.repeatCount = 10000;
let image = UIImage(named: "Spinner-0");
let imageView = UIImageView(image: image);
imageView.layer.addAnimation(rotationAnimation, forKey:"transform")
let outer = UIView(frame: imageView.bounds)
outer.addSubview(imageView)
view.addSubview(outer)
arcFlipbook = Flipbook()
arcFlipbook.renderTargetView(outer, imagePrefix: "Progress-Spinner", frameCount: 20) { (view, frame) in
return
}
Zip of my working example using CIImage: http://cl.ly/3H20450t1T0F/Flipbook-orta.zip
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.