我想以編程方式抓取屏幕截圖。所以我寫它的代碼就像,在iPhone中捕捉屏幕截圖?
CGContextRef context = [self createBitmapContextOfSize:self.frame.size];
//not sure why this is necessary...image renders upside-down and mirrored
CGAffineTransform flipVertical = CGAffineTransformMake(1, 0, 0, -1, 0, self.frame.size.height);
CGContextConcatCTM(context, flipVertical);
[self.layer renderInContext:context];
CGImageRef cgImage = CGBitmapContextCreateImage(context);
UIImage* background = [UIImage imageWithCGImage: cgImage];
CGImageRelease(cgImage);
self.currentScreen = background;
這裏所有的代碼是在UIViewController的自定義UIView。現在,當我在UIView上播放UIImageView png序列動畫時,我沒有在UIImageView的自定義UIView的子視圖中更新更改,爲什麼?我得到的唯一結果是UIImageView與第一個UIImage。
基本上我需要創建一個我的遊戲玩像一個談話湯姆應用程序的視頻。
對不起朋友我已經按照這段代碼,但它不適合我....它給了我同樣的結果。 :(upsate – Tirth 2012-01-30 07:13:53
hello RRB:此代碼正在工作到我的應用程序捕捉iPhone的截圖 – 2012-01-30 07:16:10
我可以給演示的 – 2012-01-30 07:16:58