imageview

How to set image as wallpaper from the ImageView?

笑着哭i 提交于 2019-12-03 20:48:41
I have an activity in which there are two Buttons and an ImageView. One button is to take image from the Camera application of the phone and set it to the ImageView, and other Button is to set that image as the Home screen wallpaper so i want the code how to set this image from the ImageView to the wallpaper??????? Shajeel Afzal Step 1: Get the image attached to the ImageView. Setp 2: Set that image as Wallpaper. Step 3: Add permission in the AndroidManifest.xml to set wallpaper! For step 1 check This answer! imageView.buildDrawingCache(); Bitmap bmap = imageView.getDrawingCache(); For step 2:

Android Lollipop issue - Cannot load image from camera to ImageView

老子叫甜甜 提交于 2019-12-03 20:43:10
On any version before android lollipop, the below code works fine. For some reason, from a certain version of android (around 5.0), whenever an image is captured from camera, the screen rotates 90 degrees to the right and back (Not only auto-rotate on my device is off, my activity is defined as portrait, it's not supposed to be rotating at all!). Once the screen rotates back, the ImageView presents the previous (original) image. Any suggestions? The camera intent: if (result.equals("CAMERA")) { Intent cameraIntent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);

Android: Rotate image in ImageView by 90degrees but without delay

二次信任 提交于 2019-12-03 19:36:35
问题 I am developing a game where a user needs to tap on the image in ImageView to rotate it. On each tap image rotates by 90 degrees in clockwise direction. But image is taking time to rotate from old to new position. This is hampering the gameplay experience. I have used the following: protected void onCreate(Bundle savedInstanceState) { ... ... imgview = (ImageView)findViewById(R.id.imageView1); imgview.setOnClickListener(new OnClickListener() { @Override public void onClick(View arg0) { Matrix

Gallery of images using ViewPager + zoom in ImageViews

萝らか妹 提交于 2019-12-03 18:55:02
问题 What am I trying to implement? A gallery of images using ViewPager. I choose this option because the smooth transition between images (I'm using ImageView), it is nice and quite easy to implement. What is my problem exactly? I've been able to implement all this but zoom isn't working. I can see in LogCat how it's printed ZOOM (the code is at the end of the post) but the image is not enlarged. Just a few notes about the following code: ImageViewHelperURL.setUrlDrawable((ImageView) img, url, R

Uri returned after ACTION_GET_CONTENT from gallery is not working in setImageURI() of ImageView

怎甘沉沦 提交于 2019-12-03 17:50:37
问题 I am fetching Uri of a image from gallery using Intent intent = new Intent(); intent.setType("image/*"); intent.setAction(Intent.ACTION_GET_CONTENT); startActivityForResult(Intent.createChooser(intent, "Choose Picture"), requestCode); and trying to display the image by imageView.setImageURI(uri); here, uri is Uri of the image received in onActivityResult by intent.getData(). but no image is being displayed. Also, for File file=new File( uri.getPath() ); file.exists() is returning false. 回答1:

Android ImageView drop shadow

烈酒焚心 提交于 2019-12-03 17:24:56
问题 I'm trying to add a drop shadow to an ImageView. The other Stackoverflow answer seems to be using canvas and bitmaps etc, way more complicated than it needs to be. On iOS I would do something like this: myImageView.layer.shadowColor = [UIColor redColor].CGColor; myImageView.layer.shadowRadius = 5; myImageView.layer.shadowOffset = CGRectMake(0, 5); and it would render a drop shadow, regardless of whether the shadow is being applied on a view, an image or text. I've tried to do the same on

Create Overlay ImageView Animation Google Map

梦想的初衷 提交于 2019-12-03 17:02:35
问题 I am trying to make my overlay image to do following things: onClick / onDrag of map , show a constant image at the middle of map which is a pin onTouchUp , change marker image to Loading marker and once data loading complete change loading image to new image with text. Here is a pretty similar solution to my problem: What i have done so far ? Placed an imageview over my google map in the middle , and got loacation of that imageView using mMap.getCameraPosition().target which gives approx

Rounded corners for an Imageview in android

北城余情 提交于 2019-12-03 16:12:19
I have a textview and imageview inside a linearlayout. Textview is at top and imageview at bottom. I used below lines to have rounded corners for linearlayout. But imageview corners are not rounding. I see only top corners of linearlayout are rounding. How can i have rounded bottom corners of imageview? ( I see all the corners are rounded if i remove imageview) rounded_corners.xml <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" > <solid android:color="#ffffff" /> <corners android:bottomLeftRadius="8dp" android

How to get image from sdcard in android?

▼魔方 西西 提交于 2019-12-03 15:23:30
i want create simple app in which i want get the image from sdcard but can`t success. my code is below File myFile = new File("/sdcard/photo.jpg"); ImageView jpgView = (ImageView)findViewById(R.id.imageView); BitmapDrawable d = new BitmapDrawable(getResources(), myFile.getAbsolutePath()); jpgView.setImageDrawable(d); but can`t get the image. Use below code instead of your code. File f = new File("/mnt/sdcard/photo.jpg"); ImageView mImgView1 = (ImageView)findViewById(R.id.imageView); Bitmap bmp = BitmapFactory.decodeFile(f.getAbsolutePath()); mImgView1.setImageBitmap(bmp); user2185718 package

How to make a crop camera view on SurfaceView Android

送分小仙女□ 提交于 2019-12-03 14:06:47
问题 I want to create an cropping application using surfaceview on the android operating system. I've made ​​a display surface for displaying direct view camera, but I still fails when I want to add a cropping feature directly on the camera display. Figure edits below this is going to accomplish: When the capture button is clicked then the images result will appear on the screen, as shown below: The following is the source code MainActivity.java package com.example.CameraPreview1; import java.io