android-imageview

How to download an Image by using Volley?

旧巷老猫 提交于 2020-01-14 09:59:08
问题 I am Trying to download an Image into an ImageView by using the Volley Library. I inject the response of the Volley Library into the ImageView, but I am not getting the desired result. Please check my code and suggest where I can make the changes to get the desired result. public class MainActivity extends AppCompatActivity { Button response_click; TextView text_response; RequestQueue requestQueue; ImageView image_download; String server_url="https://upload.wikimedia.org/wikipedia/commons

Enlarging an Imageview on click

微笑、不失礼 提交于 2020-01-13 13:52:12
问题 Hello Stackoverflow friendo's. I'm just wondering if someone can assist me. I've created an app which holds a lot of images, the images are currently pretty small but I want them to expand once they're clicked. Is there any way of doing this? My app holds about 50 xml and the same in classes. But it holds about 100 images, is there any simple way to do this? An example of my XML <?xml version="1.0" encoding="utf-8"?> <ScrollView xmlns:android="http://schemas.android.com/apk/res/android"

Flipping and changing image in ImageView

ぃ、小莉子 提交于 2020-01-13 04:12:47
问题 I am working on a App that is simple in work and it is working quite efficiently. But I have one place where I am looking something is not looking great and that is flipping Animation. What I Want : I have a Button and a ImageView beneath the button. On a Button click I want to make a Animation that it looks like ImageView has flipped and next image is shown in the ImageView. So on every click it should show next image with a flipping animation but there are some problems. I would discuss

Setting of ImageView's gravity to the center in android programmatically

只愿长相守 提交于 2020-01-12 11:56:30
问题 I want to set the gravity of an array of Imageviews,ImageIcons[i] to the center with the following code, ImageIcons[i] = new ImageView(this); ImageIcons[i].setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT)); layout.addView(ImageIcons[i]); And I am stuck up while setting the gravity.I request the SO people to guide me on this. Thanks 回答1: Try this LinearLayout.LayoutParams layoutParams=new LinearLayout.LayoutParams(width, height); layoutParams.gravity

get bitmap from visible zoomed image android

别来无恙 提交于 2020-01-12 03:30:08
问题 I have an Imageview which is zoomed and rotated(I have used multitouch zooming ). So how can i get bitmap of only visible content(I mean when i zoom the image , The part of the bitmap may go out of the screen. So, what i want is the bitmap that is visible on the screen). So is there any built in feature in api to create a small bitmap from a big one? or Is there any function to crop the image using x,y coordinates? actually i want the zoomed or rotated part to go to the next activity 回答1: If

Save ImageView to Android Emulator Gallery

三世轮回 提交于 2020-01-11 12:34:07
问题 I'd like to Save an Image to the Android Gallery, here's my current code: image.setDrawingCacheEnabled(true); image.buildDrawingCache(true); Bitmap b = image.getDrawingCache(); if(!new File("/"+Environment.DIRECTORY_PICTURES).exists()) Log.e("Error","/"+Environment.DIRECTORY_PICTURES+" Dont exist"); File file = new File(Environment.DIRECTORY_PICTURES+"/myImage.jpg"); file.createNewFile(); FileOutputStream ostream = new FileOutputStream(file); b.compress(CompressFormat.JPEG, 80, ostream);

How can I save my bitmap correctly for second time?

北城以北 提交于 2020-01-11 05:22:32
问题 I want to save my bitmap to cache directory. I use this code: try { File file_d = new File(dir+"screenshot.jpg"); @SuppressWarnings("unused") boolean deleted = file_d.delete(); } catch (Exception e) { // TODO: handle exception } imagePath = new File(dir+"screenshot.jpg"); FileOutputStream fos; try { fos = new FileOutputStream(imagePath); bitmap.compress(CompressFormat.JPEG, 100, fos); fos.flush(); fos.close(); } catch (FileNotFoundException e) { Log.e("GREC", e.getMessage(), e); } catch

Create a border outside the circular ImageView

我与影子孤独终老i 提交于 2020-01-11 04:15:16
问题 I have created a circular ImageView , but I need to add a border outside the image. Here is the code: Bitmap circleBitmap = Bitmap.createBitmap(100, 100, Bitmap.Config.ARGB_8888); BitmapShader shader = new BitmapShader (bitmap, TileMode.CLAMP, TileMode.CLAMP); Paint paint = new Paint(); paint.setShader(shader); paint.setAntiAlias(true); paint.setFilterBitmap(true); paint.setDither(true); paint.setColor(Color.parseColor("#BAB399")); Canvas c = new Canvas(circleBitmap); c.drawARGB(0, 0, 0, 0);

Define zoom/pan start position with KenBurnsView

☆樱花仙子☆ 提交于 2020-01-10 05:24:05
问题 I'm working with the library KenBurnsView and I have a problem: the overview or this nice library says the following: "Highly extensible: you can define how the rectangles to be zoomed and panned will be generated" and that's exactly what I want to do but I don't know exactly how. I would like to be able to tell the library to zoom or pan from a specified region (a RectF I presume) of my image. I think I have to implements my own TransitionGenerator and write a custom generateNextTransition()

Define zoom/pan start position with KenBurnsView

天涯浪子 提交于 2020-01-10 05:24:01
问题 I'm working with the library KenBurnsView and I have a problem: the overview or this nice library says the following: "Highly extensible: you can define how the rectangles to be zoomed and panned will be generated" and that's exactly what I want to do but I don't know exactly how. I would like to be able to tell the library to zoom or pan from a specified region (a RectF I presume) of my image. I think I have to implements my own TransitionGenerator and write a custom generateNextTransition()