android-imageview

How to create an imageView with shape circle and have a border? [duplicate]

蹲街弑〆低调 提交于 2019-12-12 05:37:36
问题 This question already has answers here : How to add a shadow and a border on circular imageView android? (7 answers) Closed 4 years ago . I need to create an android app with having an imageview that need to be a circle (by croping squre image). I have used some coding from StackOverFlow but I've no idea to add a border to it. Coding below: package com.fidenz.fexceller.fexceller; /** * Created by Chathu Hettiarachchi on 5/18/2015. */ import android.graphics.Bitmap; import android.graphics

Resize and Move Image in Android for Api < 11 [closed]

社会主义新天地 提交于 2019-12-12 05:14:57
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed last year . I've been trying to achieve drag and drop (Move) Api < 11 Resize (Larger than original Image) Is there any external library from which we can resize and move the image in View? External Materials, Api, Library and Links would be welcome. 回答1: Playing around with Matrix() and onTouchListener() had done by work.

null pointer exceptions when capture image

不羁岁月 提交于 2019-12-12 04:46:19
问题 My app has null pointer exceptions when it tries to take a picture with the camera. On clicked button method public void onClick(View v) { if (v.getId() == R.id.capture_btn) { try { //use standard intent to capture an image Intent captureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); //we will handle the returned data in onActivityResult startActivityForResult(captureIntent, CAMERA_CAPTURE); } catch(ActivityNotFoundException anfe){ } } } On onActivityResult method on the activity

Facing critical issue: Toggle image source inside Listview using ViewHolder Pattern

那年仲夏 提交于 2019-12-12 04:44:22
问题 Inside my Listview's ListItem i have a multiple controls and one among them is imageview. My purpose is that user when clicks on that image, source should change to something else. I am implementing ViewHolder Pattern, and right now i am able to toggle the source on click. My current problem is that when i scroll down new views are getting created(re-used), and when i try to move Up again the listitem where i toggled the image are again getting created with default image source as my

how to get the particular sub view id from the view in android?

半世苍凉 提交于 2019-12-12 04:26:01
问题 I created a dynamic view that contains FrameLayout , and it contains ImageView s. Now, when I touch the particular image on frame layout, I want know the ID of the ImageView . So, here are my questions: How can I set the ID for the ImageView ? How can I recognize particular ImageView is touched? Here is the sample snippet of the code: for (int j = 0; j < _pageslist.size(); j++) { FrameLayout frame = new FrameLayout(HLActivity.this); LayoutParams params = new FrameLayout.LayoutParams(

ImageView is not visible

有些话、适合烂在心里 提交于 2019-12-12 03:57:02
问题 I have two ImageView items in FrameLayout : imageView1 and imageView2 . imageView1 is visible and imageView2 is positioned out of screen when activity starts. Then I rotate FrameLayout on some user event using RotateAnimation so imageView2 should become visible and imageView1 should go out of screen. But imageView2 still remains invisible. Does anyone know what's the reason? The code is too large and complicated to show here. But as I have figured out the main problem in translating and

Change image to a picture in Gallery

試著忘記壹切 提交于 2019-12-12 03:45:26
问题 I am working on an application that needs to obtain a random picture from the android device's built-in picture gallery and then display it on the screen. Here's what I have to work with: -An ImageView object called picture -The ID, TITLE, DATA, MIME_TYPE, and SIZE of the picture I want to display I think the problem is I don't know what information I need to put in this line: picture.setImageResource(???); Here's all my code to give you some idea of what I'm trying to do: public void

Mask ImageView with a shape

荒凉一梦 提交于 2019-12-12 02:16:00
问题 Is it possible to mask an ImageView with a shape such as a circle? I cant seem to figure out how to do this. I would ideally like to do this in the xml file. 回答1: You can define custom shapes xml files in the drawable folder, the call them as background in imageview. 来源: https://stackoverflow.com/questions/17881104/mask-imageview-with-a-shape

Simple image gallery with HorizontalScrollView

瘦欲@ 提交于 2019-12-12 02:04:23
问题 I'm writing an image gallery with horizontal scrolling. Images must be added programatically. I use a custom horizontal scroll view to process and add images as in the following code: public void setViewList(Integer linearLayoutId, Integer[] imageIdList, Activity activity) { displayMetrics = ImageUtils.getDisplayMetric(activity); LinearLayout ll = (LinearLayout) findViewById(linearLayoutId); for (Integer imgId : imageIdList) { ImageView imageView = new ImageView(getContext()); imageView

The method setRequestProperty(String, String) in the type URLConnection is not applicable for the arguments (String, ArrayList<String>)

拟墨画扇 提交于 2019-12-12 01:21:36
问题 I am trying to send multiple images to server but,so I am storing all the images in one arraylist,but after that when I need to send to server,it shows error near line ,,...................... conn.setRequestProperty("image", multimgss); error The method setRequestProperty(String, String) in the type URLConnection is not applicable for the arguments (String, ArrayList<String>).. MainActivity public int uploadFile(String sourceFileUri) { String fileName = sourceFileUri; /*String[] mimgs = null