我有一個UIImageView我試圖動畫一肯伯恩斯般的平移/縮放操作。我想開始以臉部爲中心(具體來說,就是說,人的鼻子的末端)並縮小至圖像的整個大小。該代碼是這樣的:的iOS:肯伯恩斯動畫的實現需要意想不到的參數
image.frame = // some frame that zooms in on the image;
image.center = // tip of the nose
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:3];
[UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
image.frame = // original frame
image.center = // original centerpoint
[UIView commitAnimations];
在Photoshop中對鼻子的座標的頂端是完全從我不得不衝壓成上面的代碼時的動畫效果實際上集中在鼻子上的圖像的值不同開始。我試圖反映軸,乘以一個因素的規模......我似乎無法弄清楚爲什麼iOS的數字是顯着的v。我從Photoshop中推導出來的。
有人能說出兩個座標系之間的差異?
一些額外的信息:
image
是一個UIImageView,是一個UIViewController- 說的UIViewController的直接子水平定向 - 整個應用程序在橫向模式下運行。
有對Ken Burns效果爲iOS這裏像樣的圖書館:https://github.com/jberlana/iOSKenBurns 雖然它可以使用一個小的工作。 – shim 2013-07-14 15:10:08