crop

Android 4.3 crop gallery resultCode Cancel

会有一股神秘感。 提交于 2019-11-30 16:09:46
My Galaxy Nexus is now running on Android 4.3 allowing me to test my application with this new version. Everything seems fine except cropping. I have an application that uses the camera to take picture and then crop the image through the gallery app. I am also able to choose a picture from the gallery and crop it after. Since Android 4.3, the gallery application changed. If i take a picture with the camera api and then ask the gallery to crop it in my onActivityResult method the resultCode is set to 0 (meaning cancel) whereas i clicked on "Save" from the crop view. But if i choose a picture

Crop and rotate images with JS and PHP

社会主义新天地 提交于 2019-11-30 16:07:48
Having been Googling for a tool for a few days, I have found nothing apart from Kroppr but there's no way I can commit to using a tool that can't be tested locally before deployment. All I need is something that can provide the facility for a user to crop and rotate an image, and have the server save it, overriding the original image. There seems to be plenty of cropping tools out there but nothing that can rotate as well. Is there such a tool? No one has answered this yet? Hmmm well I think you are going to have a hard time finding a tool that does exactly what you like. I imagine you are

Crop non symmetric area of an image with Python/PIL

狂风中的少年 提交于 2019-11-30 15:45:42
问题 Is there a way to cut out non rectangular areas of an image with Python PIL? e.g. in this picture I want to exclude all black areas as well as towers, rooftops and poles. http://img153.imageshack.us/img153/5330/skybig.jpg I guess the ImagePath Module can do that, but furthermore, how can I read data of e.g. a svg file and convert it into a path? Any help will be appreciated. (My sub question is presumably the easier task: how to cut at least a circle of an image?) 回答1: If I understood

Android resizable rectangle crop

有些话、适合烂在心里 提交于 2019-11-30 15:31:11
I need to crop a picture using a resizable rectangle based on user touch events. I'm doing this because the crop intent feature isn't supported by all devices, so I'm creating my own. I have the original image as a bitmap and it's displayed on the screen as an image view. Now what I need to do next is have a rectangle (already know size it needs to be) that can be resized and moved for the user to crop the image (Say get a face). How can I create a resizable rectangle like this? CropImage has worked great for me. 来源: https://stackoverflow.com/questions/11335079/android-resizable-rectangle-crop

Crop non symmetric area of an image with Python/PIL

穿精又带淫゛_ 提交于 2019-11-30 15:17:56
Is there a way to cut out non rectangular areas of an image with Python PIL? e.g. in this picture I want to exclude all black areas as well as towers, rooftops and poles. http://img153.imageshack.us/img153/5330/skybig.jpg I guess the ImagePath Module can do that, but furthermore, how can I read data of e.g. a svg file and convert it into a path? Any help will be appreciated. (My sub question is presumably the easier task: how to cut at least a circle of an image?) Juha If I understood correctly, you want to make some areas transparent within the image. And these areas are random shaped.

Center Crop an Android VideoView

谁都会走 提交于 2019-11-30 14:35:28
问题 I am looking for something like the CENTER_CROP in ImageView.ScaleType Scale the image uniformly (maintain the image's aspect ratio) so that both dimensions (width and height) of the image will be equal to or larger than the corresponding dimension of the view (minus padding). The image is then centered in the view. From XML, use this syntax: android:scaleType="centerCrop" but for a VideoView. Does anything like this exist? 回答1: You can only achieve this with a TextureView. (surfaceView won't

openCv crop image

妖精的绣舞 提交于 2019-11-30 12:58:27
I running into problems with my openCv IplImage cropping. Assuming both tmp and img are IplImage* . Using the code: printf("Orig dimensions: %dx%d\n", img->width, img->height); cvSetImageROI(img, cvRect(0, 0,500,500)); tmp = cvCreateImage(cvGetSize(img),img->depth,img->nChannels); cvCopy(img, tmp, NULL); cvResetImageROI(img); img = cvCloneImage(tmp); printf("Orig dimensions after crop: %dx%d\n", tmp->width, tmp->height); when I use the the cvRect above I'll get an image cropped with a size of 500 x500 as expected, however when i use the rect (400,400,500,500) I'll get an image with the size

Crop Canvas / Export html5 canvas with certain width and height

吃可爱长大的小学妹 提交于 2019-11-30 12:33:19
There are hundreds of tutorials, how one can crop an image by drawImage() on a canvas. context.drawImage(imageObj, sourceX, sourceY, sourceWidth, sourceHeight, destX, destY, destWidth, destHeight); However, I have a canvas that fills the user's browser. By exporting the canvas as an image I would like to export only an area of 640px*480px from (0|0). Problem: How can I tell javascript to use only 640*480 of the canvas for the toDataURL()? Here is what I have so far: $("#submitGraphic").click( function(){ var canvas = document.getElementsByTagName("canvas"); // canvas context var context =

How to overlay one video on another in iOS?

房东的猫 提交于 2019-11-30 10:33:39
I am trying to crop an already taken video into a circle in iOS. How might I go about doing this. I know how I would do it with AVCaptureSession but I don't know to pass in an already taken video as an AVCaptureDevice? Is there a way to crop a video into a circle. I want to overlay it on top of another video so it has to have a transparent background as well. Thanks. I guess you want to produce something like this: You don't want an AVCaptureSession , because you're not capturing video. You want an AVMutableComposition . You need to read the “Editing” section of the AV Foundation Programming

Rotate and crop

主宰稳场 提交于 2019-11-30 10:17:44
I'm rotating and cropping a image with PHP, but I get the black border showing, I know you can change the background color, but I want to rotate and crop the image to fill the whole image. Basically something similar to background-size: cover; (left) in CSS versus background-size: contain; (right). See the image below, at right is what I got now, left is what I want to achieve. The number of degrees to rotate is dynamic and the image to be produced and the source-image are both square (200x200). EDIT: Here is my quick and dirty code: $rotate = imagecreatefromjpeg($image); // part of code