crop

Crop image in star shape iphone

走远了吗. 提交于 2019-12-22 10:19:21
问题 I have a image in rectangle shape but i want to crop this image in a star shape in my iphone application. so please can any one suggest how i do this? plz suggest. thanks 回答1: See the comment to a related question on how to mask an image. The magical part is CGContextClipToMask . 来源: https://stackoverflow.com/questions/5701152/crop-image-in-star-shape-iphone

crop image from YV12 or NV12 byte array

徘徊边缘 提交于 2019-12-22 09:33:29
问题 I implemented Camera.PreviewCallback in which I then get the raw image (YV12 or NV12 format) as a byte array. I'm looking for a way to crop part of that image without converting it to a bitmap. The cropped part of the image will be streamed somewhere else (as byte array again). Any help appreciated. public class CameraAccess implements Camera.PreviewCallback, LoaderCallbackInterface { private byte[] lastFrame; @Override public void onPreviewFrame(byte[] frame, Camera arg1) { synchronized(this

Crop Drawable to Square

落花浮王杯 提交于 2019-12-22 08:54:49
问题 I have a drawable that I have resized to the appropriate desired height (25dp), and the width is scaled proportionally. However, I want an image that is square, with a width of 25dp as well. However, I do not want to distort the image, so I am looking to to crop equal portions of the right and left of the drawable to give me the center 25dpx25dp. Is this possible? How? I have been trying for the past two hours and I'm about ready to throw in the towel... 回答1: Bitmap target= Bitmap

Crop pictures with Leptonica API -> OR which image processing Lib to use?

▼魔方 西西 提交于 2019-12-22 08:22:21
问题 I'm trying to do two things -> First I need to read in an image and crop it ( coordinates / frame will be provided by the user ). Then I want to run an OCR over it. ( Actually the cropping an the OCR shall be strictly divided ). Now to my problem: For the OCR I'm using Tesseract, which is using the Leptonica API for the image processing. Since I'm programing for an embedded device I want to keep the count of different libraries low. So my best interest is to crop my image with Leptonica, so I

Cropped Image size in Android is constant

牧云@^-^@ 提交于 2019-12-22 00:58:12
问题 I am cropping an image in circular fashion and using below code while creating the intent intent.setData(mImageCaptureUri); intent.putExtra("outputX", 200); intent.putExtra("outputY", 200); intent.putExtra("aspectX", 1); intent.putExtra("aspectY", 1); Since I am using outputX = 200, I am getting width and height of every cropped image as 200 and 200 , no matter how much I zoom-in or zoom out. Below shown both images have different zoom ratio but still return same height and width. width =

how to horizontally center-crop div inside other div

青春壹個敷衍的年華 提交于 2019-12-21 19:52:46
问题 Trying to horizontally center and crop (if necessary) a div inside of another div. It's possible to achieve this same effect with a background image, but in this case my content is not a single image. Fiddle: http://jsfiddle.net/7aMhY/1/ HTML: <div class="poster_container"> <div class="poster_row"> <div class="poster" style="width: 210px;">1</div> <div class="poster" style="width: 210px;">2</div> <div class="poster" style="width: 210px;">3</div> <div class="poster" style="width: 210px;">4<

Crop image white space in C#

烂漫一生 提交于 2019-12-21 19:52:38
问题 I have the request that crop image white space in C#, and I search some methods from the forum, but it could not satisfy my request. There is the original image, This is the result I expect, Any help are appreciate. 回答1: You can try to get first image data(There is an image), and draw the data into a new image. Try this method. Hope it can help you. private static Bitmap ImageTrim(Bitmap img) { //get image data BitmapData bd= img.LockBits(new Rectangle(Point.Empty, img.Size), ImageLockMode

What does the return value of SurfaceTexture.getTransformMatrix mean, who can explain?

一曲冷凌霜 提交于 2019-12-21 18:04:16
问题 Everyone, I am working with SurfaceTexture in Android but I am not able to understand Its API: getTransformMatrix(float[] mtx), the API doc is as follows: /** * Retrieve the 4x4 texture coordinate transform matrix associated with the texture image set by * the most recent call to updateTexImage. * * This transform matrix maps 2D homogeneous texture coordinates of the form (s, t, 0, 1) with s * and t in the inclusive range [0, 1] to the texture coordinate that should be used to sample * that

How can I crop image without changing its resolution in C#.Net?

百般思念 提交于 2019-12-21 05:56:00
问题 I made small program to divide large pictures and take part of them. When i import image that made by "Microsoft Paint" this image is "96 dpi" so my program doing well. But I've pictures that made by Photoshop its resolution is 71.6 dpi when i crop these pictures the new cropped picture take 96 dpi resolution so the size is deference between them. I want to crop the picture with keeping its resolution as it. . thank you very much 回答1: Bitmap.clone lets you create a cropped copy of an image,

Using just CSS, crop .img keeping aspect without distortion

回眸只為那壹抹淺笑 提交于 2019-12-21 05:21:12
问题 I have an image that has been placed inside a div. The div is 600 width and has a variable height. I want my image to sit at the top of the div. If I make the width 590 the issue is that the image is then too high in terms of design and it looks too dominant on the page (because its ratio is roughly 4:3 etc). So I want to make the image 590 by 200. If i use... .img { width: 590px; max-height: 200px; } ...then the image sits inside the div exactly how I want it. However, the photo itself is