2013-03-15 37 views
0

我需要知道如何在iOS中剪輯圖片。我已經在J2ME中使用畫布集剪輯方法工作。現在我想知道如何在iOS中執行此操作。這是我想要的一個例子。iOS中的setclip方法圖片

這是原始圖像我在故事板

this this image the original image what i'm drawing in storybord

this is the image what i want to do. i want to hide the some part of that red image

這我畫的是什麼我想達到的圖像。我想隱藏紅色圖像的某個部分。

我嘗試了這樣的事情,但我不能做我想做的。

UIImageView *imv = [[UIImageView alloc]initWithFrame:CGRectMake(0 ,305, 98, 139)]; 
    imv.image=[UIImage imageNamed:@"red.png"]; 

    imv.frame = CGRectMake(0 ,305, 98, redImageHeight); 
    imv.clipsToBounds = YES; 
    imv.contentMode = UIViewContentModeTop; 
    [self.view addSubview:imv]; 
+0

你想調整圖像填充圖像視圖的邊界? – 2013-03-15 05:52:40

+0

@喬治我沒有讓你。你能告訴我一些代碼或者更多地解釋我.. – 2013-03-15 05:57:10

回答

0

試圖改變

imv.contentMode = UIViewContentModeScaleToFill; 
0

你爲什麼不通過一個使用此欄和顯示一個多剪輯我認爲這將是更容易