crop

Android Freehand bitmap cropping

删除回忆录丶 提交于 2019-12-08 05:47:14
问题 I know we can crop a bitmap in rectangular shape using: Bitmap.createBitmap(source, x, y, width, height) But I want to know to crop a bitmap in freehand mode or some polygon shape. Its best example can be seen in Jigsaw Puzzle game I have spent a lot of time googling about this but found no help. Can anybody help me in this regard? 回答1: You can use a Path to determine a clip area on your Canvas when drawing a Bitmap . For a full example see: Android - Crop an image from multipoints and also:

SVG view box crop using jquery

半城伤御伤魂 提交于 2019-12-08 05:40:28
问题 I am doing sticker website for my client. They need image crop within given SVG image. That SVG image is unshaped like Halloween face (see below). When i upload an image, it will display within the given image. The rest of the image will hide. How can i achieve this? 回答1: This is really quite easy with SVG clipPaths. It has good browser support as well, except of course IE. .defs { position: absolute; width: 0; height: 0; } .demo { text-align:center; } .star image { clip-path: url(#star-clip)

Image cropping/resizing before sending to a server

霸气de小男生 提交于 2019-12-08 04:43:30
问题 I am searching for a solution that will allow a user to upload an image, crop the image, and then send the updated image to the server. Basically, I would like to handle all the editing client side and only send the new, smaller, thumbnail to the server. How can I do this? I have seen this is possible with Flash, but I am looking for alternative solutions. 回答1: Are you restricted to certain browsers? Using HTML5, here is a proof of concept from Anand Venkataraman. Demo is here. 来源: https:/

getting unexpected result of crop video using AVFoundation

老子叫甜甜 提交于 2019-12-08 04:36:05
问题 I have video of 1920*1080(16:9) and I want to crop that video by middle pixel of 1080*1080(1:1). For that I wrote below code. -(void)cropVideo { AVMutableComposition *mixComposition = [[AVMutableComposition alloc] init]; AVMutableCompositionTrack *track = [mixComposition addMutableTrackWithMediaType:AVMediaTypeVideo preferredTrackID:kCMPersistentTrackID_Invalid]; AVMutableCompositionTrack *track1 = [mixComposition addMutableTrackWithMediaType:AVMediaTypeAudio preferredTrackID

Image cropping/resizing before sending to a server

和自甴很熟 提交于 2019-12-08 04:21:27
I am searching for a solution that will allow a user to upload an image, crop the image, and then send the updated image to the server. Basically, I would like to handle all the editing client side and only send the new, smaller, thumbnail to the server. How can I do this? I have seen this is possible with Flash, but I am looking for alternative solutions. Are you restricted to certain browsers? Using HTML5, here is a proof of concept from Anand Venkataraman. Demo is here . 来源: https://stackoverflow.com/questions/5492736/image-cropping-resizing-before-sending-to-a-server

Lossless jpeg batch crop

好久不见. 提交于 2019-12-08 04:18:41
问题 I need to crop a bunch of jpegs by 20 pixels on the right side losslessly. Do you know about any software that can do that? I checked jpegtran but it needs the file size in pixels before cropping and I don't know how to build a batch file with that. Any ideas? 回答1: My shell scripting is a little rusty so please make a backup of your images before trying this script. #!/bin/bash FILES=/path/to/*.jpg for f in $FILES do identify $f | awk '{ split($3, f, "x"); f[1] -= 20; cl = sprintf("jpegtran

Crop Landscape Image Dynamically

浪子不回头ぞ 提交于 2019-12-08 04:18:12
问题 I want to crop Image according to red View . There are some points to keep in mind. 1.Image can be scrolled and Zoomed. 2.Red ImageView is created Dynamically according to Image UIImage* whole = [UIImage imageNamed:@"9.png"]; //I uses this image CGImageRef cgImg = CGImageCreateWithImageInRect(whole.CGImage, CGRectMake(x, y, incX, incY)); UIImage* part = [UIImage imageWithCGImage:cgImg]; I just want to know How to find the Values of x, y, incX, incY Thanks... Scenario 1: Normal (Not Scrolled)

Any good libraries for Cropping Images in Android on Eclipse

梦想与她 提交于 2019-12-08 04:13:46
问题 I need to crop android images. Basically, I need to pick an image from the Gallery and crop it. I am using Eclipse. I haven't made the switch to Gradle. The present library that I am using is not reliable import eu.janmuller.android.simplecropimage.CropImage; Some of my users are having issues in that when they try to crop the image behaves strangely and sometimes disappears entirely. So I need something that is much more reliable. I was going to try https://github.com/jdamcd/android-crop but

How to do properly cropping of UIImage taken with UIImagePickerController?

空扰寡人 提交于 2019-12-08 04:07:08
问题 This is camera overlay for my app, The yellow square is to indicate user that only photo inside this part (in camera) will be saved. It's like crop. When I saved that capture image, it'll save zoomed photo [a big zoomed on photo], What I found is, when I took a photo, it'll be of size of {2448, 3264} I'm cropping the image like this, - (UIImage *)imageByCroppingImage:(UIImage *)image toSize:(CGSize)size { double x = (image.size.width - size.width) / 2.0; double y = (image.size.height - size

Crop Landscape Image Dynamically

偶尔善良 提交于 2019-12-08 03:49:27
I want to crop Image according to red View . There are some points to keep in mind. 1.Image can be scrolled and Zoomed. 2.Red ImageView is created Dynamically according to Image UIImage* whole = [UIImage imageNamed:@"9.png"]; //I uses this image CGImageRef cgImg = CGImageCreateWithImageInRect(whole.CGImage, CGRectMake(x, y, incX, incY)); UIImage* part = [UIImage imageWithCGImage:cgImg]; I just want to know How to find the Values of x, y, incX, incY Thanks... Scenario 1: Normal (Not Scrolled) Expected Result (Ignore Black Border On Top and Bottom) Scenario 2:Scrolled Expected Result (Ignore