2010-06-09 83 views

回答

3

您必須具有創造性,您必須抓住用戶的觸摸點和(因爲用戶觸摸屏幕並在屏幕上移動)在主屏幕上繪製點,線,圓或圖像你正在使用的對象/視圖。如果您想將屏幕保存爲圖像,則可以使用抓取應用程序的快照或查看並在本地存儲它。

蘋果公司得到了一個簡單的應用程序,http://developer.apple.com/iphone/library/samplecode/GLPaint/Introduction/Intro.html。一旦你下載它,你可以看到它是如何捕捉觸摸點並繪製線條。只要修改它所描繪的內容即可。

希望我幫了忙,Apple Development對我來說就是這樣一個灰色地帶。

+0

哦,動態創建的圖像看GLSprite示例代碼, http://developer.apple.com/iphone/library/samplecode/GLSPrite/Introduction/Intro.html。基本上創建紋理並將圖像添加到用戶點擊的位置。 希望它有幫助! – JustinKaz 2010-06-09 20:02:25

3

田田!!!

圖文並茂:

- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *) event { 

UITouch *touch = [touches anyObject]; 
touchPoint = [touch locationInView:self.view]; 

CGRect myImageRect = CGRectMake(touchPoint.x, touchPoint.y, 20.0f, 20.0f); 
UIImageView *myImage = [[UIImageView alloc] initWithFrame:myImageRect]; 
[myImage setImage:[UIImage imageNamed:@"YourImage.png"]]; 
myImage.opaque = YES; // explicitly opaque for performance 
[self.view addSubview:myImage]; 
[myImage release]; 

}

此代碼,無論你觸摸將繪製的圖像!

我無法在設備上測試它,但我相信它只會滯後一點點。

石英(因爲屏幕上的許多圖片):

第二種方法是使用石英,試試這個鏈接:http://www.ipodtouchfans.com/forums/showthread.php?t=132024