crop

Is there any code to set wallpaper without cropping and zooming in android?

十年热恋 提交于 2019-12-05 11:00:16
i am creating a gallery app , my first app and this is my code Bitmap bmd = BitmapFactory.decodeStream(is); try{ getApplicationContext().setWallpaper(bmd); }catch(IOException e){ e.printStackTrace(); } The above code sets wallpaper But the wallpaper gets cropped or zoomed after it got set !! Is there any modification i can do in the above code so that i can set wallpaper without zooming or cropping when it is set !!!! Plzzzz help me out !! Thanks in advance :-) I am late to reply this. Hope it helps you and those who visits your question: In your case, try to adjust your picture to device size

Android - Crop image taken from camera with resizable ,independant height and width of cropped area

落花浮王杯 提交于 2019-12-05 08:04:42
问题 I am developing app where i want to crop image taken from camera and upload to sftp server. I am using following code to crop image: BitmapFactory.Options opts = new BitmapFactory.Options(); opts.inSampleSize = 1; Bitmap bm = BitmapFactory.decodeFile(imagePath, opts); Intent intent = new Intent("com.android.camera.action.CROP"); intent .setDataAndType(outputFileUri, "image/*"); intent.putExtra("outputX",bm.getWidth()); intent.putExtra("outputY", bm.getHeight()); intent.putExtra("aspectX", 1);

move,scale and crop the image in android like facebook profile picture

点点圈 提交于 2019-12-05 06:23:58
I want crop an image in my application.I tried a lot but not succeed. Its challenge to android developer. Is there any idea or reference to implement the features move,scale and crop the image in android like facebook upload profile pic. Now i am able to move, scale and crop and the image.But not consistant like facebook.I want to set fix image scale based on orientation.I attached the screen shot-3. My code as below:- crop_image.xml <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout

How to crop and then resize with Paperclip

本小妞迷上赌 提交于 2019-12-05 02:18:06
问题 I have a photo attachment which I'm saving using Paperclip. However, I'd like to process the photo first before saving by cropping it down and then resizing to the final size: e.g. I have a 900x900 photo, I want to first do a central crop to 500x500, and then resize the cropped photo down to a thumbnail size of 100x100. The purpose of this is so that the thumbnail image wouldn't simply be a scaled down version of the 900x900 since it might be too small to even make out anything in the photo.

How to crop image and save into ImageSource in WPF?

帅比萌擦擦* 提交于 2019-12-05 01:30:35
问题 I am new learner to WPF. here I got a question. I have a image, width:360, height:360. Here I want to crop this image like below: ( 0,0 ) to (120,120) save to the first ImageSource object, (120,0 ) to (240,120) save to the second ImageSource object, (240,0 ) to (360,120) save to the third ImageSource object;, …… pls see more details in below picture: My code sample below: private void CutImage(string img) { int iLeft = 0; int iTop = 0; int count = 0; Image thisImg = new Image(); BitmapImage

Crop image ala Google Goggles

此生再无相见时 提交于 2019-12-04 23:41:26
问题 I'm trying to do some ROI (region of interest) selection in my app, but I don´t know, how to create some kind of resizable (by fingers) rectangle like you can see in Google Goggles. Can you help me? Is there any source code example? 回答1: My final solution is to draw and rectangle in the midle of a view and implement onTouchEvent() in my activity to set new corners coordinates like this: @Override public boolean onTouchEvent(MotionEvent me) { if(SETTING_ROI == true){ if (me.getAction() ==

Image not cropping

霸气de小男生 提交于 2019-12-04 22:26:47
问题 I am setting a background image to LinearLayout like this: 1.back_xml: <?xml version="1.0" encoding="UTF-8"?> <layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <item android:drawable="@drawable/back" > </item> <item> <shape> <solid/> <stroke android:width="1dip" android:color="#225786" /> <corners android:radius="10dip"/> <padding android:left="0dip" android:top="0dip" android:right="0dip" android:bottom="0dip" /> </shape> </item> 2. tile.xml <bitmap xmlns:android="http:

Cropping image in iPhone

痞子三分冷 提交于 2019-12-04 21:49:39
I like to crop a image in UIImageView. Can you provide me the full source code that will helpful for me. NIKHIL It may help You UIImage* whole = [UIImage imageNamed:@"whole.jpg"]; //I know this image is 300x300 CGImageRef cgImg = CGImageCreateWithImageInRect(whole.CGImage, CGRectMake(x, y, 100, 100)); UIImage* part = [UIImage imageWithCGImage:cgImg]; UIImageView* Croppedimage = [[UIImageView alloc] initWithImage:part]; and Below is the link more-usefull how to crop image in to pieces programmatically Good luck I used to crop the image in same UIImageview 1)Store the image uiimageview 2)Take

Implement a Take Picture + Crop or use premade Intents?

断了今生、忘了曾经 提交于 2019-12-04 20:16:44
I'm in the middle of an Android app which takes a picture, crops it and does some extra stuff. I was hoping to do my own cropping system , but the problem comes when I test in different places. Pictures appear rotated in some cases, and not correctly cropped in others (like they had an extra margin around (seeing extra space of the original picture), or so). More on that, I've considered using Intents . This would release me from the picture taking madness, the cropping, and would add an interesting "get from gallery" option, which I haven't implemented yet. Crop intent may not be in every

Cropped Image size in Android is constant

自古美人都是妖i 提交于 2019-12-04 19:24:14
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 = bitmap.getWidth(); Can someone please tell me what parameter should I use in line intent.putExtra("outputX