Open duke4e opened 10 years ago
Interesting...
Could you show us with some example how to capture screenshot with icarousel?
Screenshot code: https://stackoverflow.com/questions/2200736/how-to-take-a-screenshot-programmatically
Hacked iCarousel (for my personal use): http://www.mediafire.com/download/9488ya5yn8rd1bl/iCarousel.zip
Usage is same as in normal iCarousel, but note that most of transforms don't work as intended since they need a proper 3D translation. Best using iCarouselTypeLinear.
On iOS 7 and above you can use the new [UIView drawViewHierarchyInRect:afterScreenUpdates:] method to capture iCarousel screenshots.
Unfortunately, prior to iOS 7, there is no way to capture iCarousel screenshots. The hack that duke4e implemented works for 2D carousels, but not 3D ones.
How a complete iCarousel screenshot can be rendered on Mac?
I have no idea, sorry. I do know that [carousel.layer renderInContext:] won't work though.
Hello, we found a very nice way to have iCarousel screenshot working on Mac and iOS 6/7. If you are interested we can share our code.
Hi @creoapp, yes, I would be interested to know how you achieved this.
Since iCarousel uses 3D transformations, when you get a screenshot of view iCarousel isn't rendered to the screenshot. That's why I propose to add an option to use 2D transformations. Of course, that means that not all carousel types will look ok, but that's ok with me, and should probably be ok with anyone that needs to make a screenshot.
So, on to the patch:
in compareViewDepth, add something like this:
and in containView:
I didn's send this as a pull request so you can think about this idea and implement it in the way that you think is best suitable for iCarousel.