crop

How to crop images from camera

天涯浪子 提交于 2019-11-27 15:11:13
问题 How can I crop the camera images. Now it is showing the the image for crop and after selecting the crop section while tap on the " Save " button. Its showing as " saving image ". After that nothing is happen. Here is my code. Button click : Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); intent.putExtra(MediaStore.EXTRA_OUTPUT, MediaStore.Images.Media.EXTERNAL_CONTENT_URI.toString()); intent.putExtra("crop", "true"); intent.putExtra("aspectX", 0); intent.putExtra("aspectY", 0);

Crop an Image by passing the image file path in Android

主宰稳场 提交于 2019-11-27 14:31:38
I have tried the below code. However, it always results the 160*160 dimension image. try { //call the standard crop action intent (the user device may not support it) Intent cropIntent = new Intent("com.android.camera.action.CROP"); //indicate image type and Uri cropIntent.setDataAndType(Uri.fromFile(pictureFile), "image/*"); //set crop properties cropIntent.putExtra("crop", "true"); //indicate aspect of desired crop cropIntent.putExtra("aspectX", 100); cropIntent.putExtra("aspectY", 100); cropIntent.putExtra("scale", true); //indicate output X and Y cropIntent.putExtra("outputX", 500);

Android Camera Intent with Crop

血红的双手。 提交于 2019-11-27 14:13:10
问题 I've been trying to crop and resize an image while taking a picture through the camera intent but don't understand what I'm doing wrong here -- can't get the cropped image data even if the file is correctly saved on the phone. ... public class Add extends Activity { private String imageFilePath; ... protected void onCreate(Bundle savedInstanceState) { ... imageFilePath = Environment.getExternalStorageDirectory().getAbsolutePath() + "/tmp/" + String.valueOf(System.currentTimeMillis()) + ".jpg"

Copy and crop images in Javascript

China☆狼群 提交于 2019-11-27 14:06:26
问题 I'm trying to create a small 2D game in Javascript/Canvas which consists of several animated sprites. I'd like to cut down on the number of HTTP requests, so I combined each frame of animation (32px by 32px) into one image per sprite (say, 192px by 128px). Is there any way I can copy and crop these images clientside back into several smaller images? It would vastly simplify my rendering code and help reduce loading time due to network latency. 回答1: Have a look at Pixastic, specifically http:/

Resizing the image in php for viewing purposes only

半腔热情 提交于 2019-11-27 13:20:32
问题 Okay, the reason I posted this is because I wasn't sure what to search for. I'll try to explain it as clearly as I can. Say, I have an image sized 800x600. The box I've allotted for the image is 150x150 and has to be satisfied at all times. I can only allow an image to be shown at a maximum size of 150px for both height and width. So, technically, the image has to be scaled down to 200x150. Now, the question : Is there a way I can crop the height so it only shows 150x150? This is for viewing

How to Locate Alignment Marks in an Image

六眼飞鱼酱① 提交于 2019-11-27 13:09:24
问题 I am designing a system that will scan in standardized forms to images (e.g., TBitmap). I would like to identify alignment marks on these pages and use the locations of these crop marks to rotate the page to its proper orientation (so top is actually up) and to crop the image to the location of the alignment marks. An example image of a typical mark I'd need to locate is: (source: tpub.com) What are techniques to evaluate an image obtained from a scanner to locate various marks within the

Crop image by polygon area

徘徊边缘 提交于 2019-11-27 12:34:48
问题 I want to crop image by polygon area, but couldn`t find any library, which can make it. OpenCV is too big for this small thing. JJIL [enter link description here] crop just rectangle area. Maybe you have any ideas how i can achieve it? Thanks for help! FOR Nidhi: Try something like this, if doesnot work - create another canvas for path, and than get Bitmap from it (for mask), and apply this mask bitmap to your initial canvas instead drawPath. Bitmap obmp = BitmapFactory.decodeResource

Crop Image with face detection in android

不羁岁月 提交于 2019-11-27 12:11:11
I needed a demo where any image can be cropped with the face detection function. FIXED But after few surfing hours I didn't come to a single demo, so I prepared a single demo with conjunction of few demos that I found online. I have prepared a demo to crop the image. My demo crops the image rectangle, and circular as well. Also it detects the face and crops the image according to the face detection. I am using the following image to crop it. And the screenshot of the crop result is : The xml for the example is : <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns

How to animate ImageView from center-crop to fill the screen and vice versa (facebook style)?

旧街凉风 提交于 2019-11-27 12:07:04
Background Facebook app has a nice transition animation between a small image on a post, and an enlarged mode of it that the user can also zoom to it. As I see it, the animation not only enlarges and moves the imageView according to its previous location and size, but also reveals content instead of stretching the content of the imageView. This can be seen using the next sketch i've made: The question How did they do it? did they really have 2 views animating to reveal the content? How did they make it so fluid as if it's a single view? the only tutorial i've seen (link here ) of an image that

Clipping raster using shapefile in R, but keeping the geometry of the shapefile

[亡魂溺海] 提交于 2019-11-27 11:42:16
问题 I am using {raster} to clip (or crop) a raster based on an irregular shapefile (the Amazon biome) but the output always has a rectangular extent. However, I need the output in the exact same geometry of the shapefile. Any tips? Cheers. library(raster) library(rgdal) myshp <- readOGR("Amazon.shp", layer="Amazon") e <- extent(myshp) myraster <- raster("Temperature.tif") myraster.crop <- crop(myraster, e, snap="out", filename="myoutput.tif") 回答1: One option is to use raster::mask() library