crop

how to change the UIImagePickerController crop frame

∥☆過路亽.° 提交于 2019-11-28 06:49:39
when opening working with an UIImagePickerController and setting allowsImageEditing = YES; there is a default cropping frame that is 320x320. In my case, I would like to setup that cropping frame to 320x240 for images that are landscape, and 240x320 for images that are portrait. However, I haven't been able to find a way to change that 320x320 frame that is used when editing /cropping a photo. Has any of you found a way to do it? Thanks! You have to implement it your self. The picker only performs 320x320 cropping. So instead set allowsImageEditing = NO; Now you will get the full image back.

Image Cropping using Python

£可爱£侵袭症+ 提交于 2019-11-28 06:38:33
I am new to Python coding and I am writing a program in which I will be cropping an entered image and then saving it in a location. Now, I am being able to do this using a combination of PIL and pygame. But the problem is that, when I am selecting the image from the open pygame window, the selection area is totally opaque and I am not able to see through the region I am selecting. This is causing problems for my boss who wants to be able to see through it as he selects. For you guys to better understand the problem, I am writing my code here: import pygame, sys from PIL import Image pygame

How to create an image from a UIView / UIScrollView

前提是你 提交于 2019-11-28 06:36:56
I have an image in an UIScrollView, that can be scrolled and zoomed. When the user presses a button, I want the code to create an image from whatever part of the UIScrollView is inside an area I specify with a CGRect. I've seen code to crop UIImages, but I can't adapt it to do the same for a view, because it uses CGContextDrawImage. Any thoughts? Cheers, Andre I've managed to get it. Here's my solution, based on a few different ones from the web: - (UIImage *)imageByCropping:(UIScrollView *)imageToCrop toRect:(CGRect)rect { CGSize pageSize = rect.size; UIGraphicsBeginImageContext(pageSize);

Crop UIImage to center square

给你一囗甜甜゛ 提交于 2019-11-28 06:29:07
问题 I get images that are in 1920x1080 resolution. I am attempting to crop them to the center square area (ie 1080x1080 square in the center). The resolution may change in the future. Would it be possible to crop the image this way? I have tried a couple things posted on SO, but I always get an image that is 660x1080 if I try to crop then center. Here is an image depicting what I want to achieve. Basically the red is original, green is what I want, and yellow is just showing mixX and midY lines.

PIL crop and paste problem: Cropping doesn't create a cropped image

本秂侑毒 提交于 2019-11-28 06:03:52
问题 I'm trying to crop an image and then paste the cropped image into the centre of another image. Ideally I'd like the cropped image to be smaller than the image its being pasted on so that there is a border around the pasted image but I don't know if that's possible. Here's what I've tried (along with the resulting error message): >>> import Image >>> grey = Image.new('RGB', (200, 200), "grey") >>> House = Image.open("House01.jpg") >>> print grey.size, grey.mode, grey.format >>>(200, 200) RGB

Custom Android Image Crop

拜拜、爱过 提交于 2019-11-28 03:52:03
i just want to share this piece of code that i wrote. I tried searching for a custom crop activity, but most of them leads to the default "com.android.camera.action.CROP" despite the question custom crop, or freehand crop activity. Anyway, i just made one for myself, and hopefully it will help you guys. public class CropView extends ImageView { Paint paint = new Paint(); private int initial_size = 300; private static Point leftTop, rightBottom, center, previous; private static final int DRAG= 0; private static final int LEFT= 1; private static final int TOP= 2; private static final int RIGHT=

Make Jcrop tracker not rotate when cropping a rotated image

有些话、适合烂在心里 提交于 2019-11-28 03:30:27
问题 I'm trying to crop an image using Jcrop, but when I use jqueryrotate on the image, something weird happens. I rotate the image 90 degress then I activate the JCrop, the JCrop does not follow the image rotated, so I also rotate the Jcrop-holder. The resulting image is ok, but when I select a section to crop, I have noticed that my tracker is also rotated. When I drag it up, it goes right, when I drag it left, it goes down. What happens Then it goes How do I make the crop selection tool stay

Crop does not work for gallery images

与世无争的帅哥 提交于 2019-11-28 02:17:08
I am using the following code to crop images from camera and gallery : private void doCrop() { final ArrayList<CropOption> cropOptions = new ArrayList<CropOption>(); Intent intent = new Intent("com.android.camera.action.CROP"); intent.setType("image/*"); List<ResolveInfo> list = getPackageManager().queryIntentActivities(intent, 0); int size = list.size(); if (size == 0) { Toast.makeText(this, getApplicationContext().getString(R.string.crop_unavailable), Toast.LENGTH_SHORT).show(); // return } else { intent.setData(mImageCaptureUri); int y = 200; if(lastSelect == 1 || lastSelect == 2 ||

Explanation of Android Code Camera Intent + Cropping Images

好久不见. 提交于 2019-11-28 02:07:53
问题 When wanting to take a photo, crop and save the image in an Android application, I use the following intent in my Java... Intent camera=new Intent(); camera.setAction(MediaStore.ACTION_IMAGE_CAPTURE); camera.putExtra("crop", "true"); camera.putExtra("outputX",600); camera.putExtra("outputY", 600); camera.putExtra("aspectX", 1); camera.putExtra("aspectY", 1); camera.putExtra("scale", true); camera.putExtra("return-data", false); The above intent works great, however my Y and X are always equal

How to change WooCommerce thumbnail crop position?

拈花ヽ惹草 提交于 2019-11-28 01:52:36
问题 I'm trying to change WooCommerce thumbnail crop position. I found this code can help to change the size: add_action( 'init', 'yourtheme_woocommerce_image_dimensions', 1 ); /** * Define image sizes */ function yourtheme_woocommerce_image_dimensions() { $catalog = array( 'width' => '100', // px 'height' => '100', // px 'crop' => 0 ); // Image sizes update_option( 'shop_catalog_image_size', $catalog ); // Product category thumbs } I did some try like change crop 0 to array("center", "bottom")