crop

Crop image in PHP

守給你的承諾、 提交于 2020-01-18 04:09:05
问题 The code below crops the image well, which is what i want, but for larger images, it wotn work as well. Is there any way of 'zooming out of the image' Idealy i would be able to have each image roughly the same size before cropping so that i would get good results each time Code is <?php $image = $_GET['src']; // the image to crop $dest_image = 'images/cropped_whatever.jpg'; // make sure the directory is writeable $img = imagecreatetruecolor('200','150'); $org_img = imagecreatefromjpeg($image)

Android 2.1 Crop Image Fail

夙愿已清 提交于 2020-01-17 02:13:27
问题 I followed this page to crop image on SDcard How to select and crop an image in android? i placed the cropped image in /data/data/package.name/files , code works fine on Android 2.2 and above but when i ran this code on Android 2.1, after selecting the region i want and click "Save" and i always got "FAILED BINDER TRANSACTION" error. Why and what is that error? 回答1: You want like this:- How to Select and Crop Image on Android? Download Sample:- https://github.com/lorensiuswlt/AndroidImageCrop

Custom Camera and Crop image in Swift

纵饮孤独 提交于 2020-01-16 17:09:58
问题 I have created a custom camera and have implemented below code to crop the taken image, I have shown guides in the preview layer so I want to crop the image which appears in that area. func imageByCropToRect(rect:CGRect, scale:Bool) -> UIImage { var rect = rect var scaleFactor: CGFloat = 1.0 if scale { scaleFactor = self.scale rect.origin.x *= scaleFactor rect.origin.y *= scaleFactor rect.size.width *= scaleFactor rect.size.height *= scaleFactor } var image: UIImage? = nil; if rect.size.width

Custom Camera and Crop image in Swift

╄→гoц情女王★ 提交于 2020-01-16 17:09:08
问题 I have created a custom camera and have implemented below code to crop the taken image, I have shown guides in the preview layer so I want to crop the image which appears in that area. func imageByCropToRect(rect:CGRect, scale:Bool) -> UIImage { var rect = rect var scaleFactor: CGFloat = 1.0 if scale { scaleFactor = self.scale rect.origin.x *= scaleFactor rect.origin.y *= scaleFactor rect.size.width *= scaleFactor rect.size.height *= scaleFactor } var image: UIImage? = nil; if rect.size.width

center Crop Image In proper size to set on ImageView

荒凉一梦 提交于 2020-01-15 18:39:05
问题 I am using camera API to take picture i have to open camera in different sizes according to my Image view size. I am following the sample project which we get inside Android sdk/sample/adroid-18 at the name "ApiDemo" the thing i have changed is not set camera on setcontentview. I have set the camera on Frame Layout. at first my camera preview was starched so i got the camera OptimalPreviewSize and make FrameLayout parameter width and height as wrap-content.Now the camera preview is smaller

center Crop Image In proper size to set on ImageView

Deadly 提交于 2020-01-15 18:35:03
问题 I am using camera API to take picture i have to open camera in different sizes according to my Image view size. I am following the sample project which we get inside Android sdk/sample/adroid-18 at the name "ApiDemo" the thing i have changed is not set camera on setcontentview. I have set the camera on Frame Layout. at first my camera preview was starched so i got the camera OptimalPreviewSize and make FrameLayout parameter width and height as wrap-content.Now the camera preview is smaller

Cropping captured image is blur in android

时光总嘲笑我的痴心妄想 提交于 2020-01-15 12:38:07
问题 Hi basically I am selecting image form gallery or capture from camera and cropping it. If I crop image which is selected from gallery is no blur its fine but if I crop captured images means its getting blur. To start camera I have used private void cameraIntent() { Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); startActivityForResult(intent, REQUEST_CAMERA); } and in camera onActivityResult private void onCaptureImageResult(Intent data) { Bitmap bm = (Bitmap) data.getExtras()

Cropping videos in iOS

人盡茶涼 提交于 2020-01-12 03:21:08
问题 We can crop images. Can we crop videos? 回答1: Since video is a collection of pictures you can crop all frames from video and after create new video. AVFoundation guide describe some tasks: Putting it all Together: Capturing Video Frames as UIImage Objects After this you crops images and write video You can use an asset writer to produce a QuickTime movie file or an MPEG-4 file from media such as sample buffers or still images. See for more details AV Foundation Framework 回答2: [[NSFileManager

Cropping videos in iOS

百般思念 提交于 2020-01-12 03:21:07
问题 We can crop images. Can we crop videos? 回答1: Since video is a collection of pictures you can crop all frames from video and after create new video. AVFoundation guide describe some tasks: Putting it all Together: Capturing Video Frames as UIImage Objects After this you crops images and write video You can use an asset writer to produce a QuickTime movie file or an MPEG-4 file from media such as sample buffers or still images. See for more details AV Foundation Framework 回答2: [[NSFileManager

How does Instagram crop video in android app?

百般思念 提交于 2020-01-11 10:42:55
问题 I am trying to record the video in 1:1 ratio (square) and i cant get it to work, if i set custom resolution in media recorder instance i get an error on media recorder start. mediaRecorder.setVideoSize(480, 480); but it works if i set the resolution supported by camera. Camera.Parameters p = c.getParameters(); List<Camera.Size> list = p.getSupportedPreviewSizes(); //They are ordered from largest to smallest, so the largest will be... for (Camera.Size i : list) { if (i.width <= 640 && i.width