我想在捕獲後裁剪圖像或從庫中選擇圖像。如何更改UIImagePickerController裁剪區域的可顯示框架大小。在Swift中爲「CropRect」設置固定的寬度和高度
我附上了一張圖片,以瞭解我的問題 當我捕捉或選擇圖像時,我得到紅色方框。其實我想要做的是將紅色方框大小調整爲綠色方塊。
func openGallary()
{
picker!.sourceType = UIImagePickerControllerSourceType.PhotoLibrary
picker!.allowsEditing = true;
picker!.delegate = self;
if UIDevice.currentDevice().userInterfaceIdiom == .Phone
{
self.presentViewController(picker!, animated: true, completion: nil)
}
else
{
popover=UIPopoverController(contentViewController: picker!)
popover!.presentPopoverFromRect(editPP.frame, inView: self.view, permittedArrowDirections: UIPopoverArrowDirection.Any, animated: true)
}
}
發表你試過的東西? –
我附上了一張圖片以方便使用。 – Sulo
你應該添加代碼,你已經嘗試以及你面臨的問題。 –