imageview

How to take screenshot for Android Surface view

淺唱寂寞╮ 提交于 2019-12-06 10:52:22
问题 I'm try to implement Take a Screenshot form my camera Surface view through code. I able to do of those things, however the screenshot always appears black. Here is the Code. i have searched many links and implement my code. but still screenshot appear black. how to resolve this. please guide me. thanks public class Cam_View extends Activity implements SurfaceHolder.Callback { protected static final int CAPTURE_IMAGE_ACTIVITY_REQUEST_CODE = 0; private SurfaceView SurView; private SurfaceHolder

Image is not loaded using Glide

半腔热情 提交于 2019-12-06 10:50:13
I have a vector image. If I want to set the image to ImageView, the picture is not loaded. code: Glide.with(this).load(R.drawable.vector_image).into(imageView) However, when I use: imageView.setImageDrawable(ContextCompat.getDrawable(this, R.drawable.vector_image)) and it is working. Any ideas? Glide doesn't support vector drawables yet. So implementing vector drawables you have to do yourself. For reference you can check below links for this issue reported by developers on github: link 1 link 2 You can use like this. Glide.with(this) .load("") .placeholder(R.drawable.vector_image) .into

Android ImageView - Load Image from URL [closed]

孤人 提交于 2019-12-06 10:23:33
问题 Closed . This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 5 years ago . I have a number of "contact" objects each with an imageURL String associated with them. All the ways I've seen of putting images into a ListView involve manually putting images into a "drawable" folder and calling resources. Manually entering the images in would defeat the purpose of this. I've

ImageView Android RAM

泪湿孤枕 提交于 2019-12-06 09:51:42
问题 A followup from my original question. Is there a way to use ImageViews in android apps without using a lot of RAM? In the original question I found that my app used a lot of RAM, and found that it was the ImageViews which I used that too up all the RAM. To get the Image I use public void addPictureOnClick(View view){ Intent intent = new Intent(); intent.setType("image/*"); intent.setAction(Intent.ACTION_GET_CONTENT); startActivityForResult(Intent.createChooser(intent, "Select Picture"),1); }

Add imageViews dynamically on Android

99封情书 提交于 2019-12-06 09:20:38
I want display images from HTML, and I get image url source using Jsoup . But, a problem is that each post has a different number of pictures. So, I can't fix the number of ImageViews in xml layout. After I researched, I know that I can create ImageViews dynamically. So, I create ImageViews and insert them into Linearlayout . But, I can only see one picture which I inserted lastly. package kr.ac.mju.hanmaeum.activity.notice; import android.content.Intent; import android.media.Image; import android.os.AsyncTask; import android.os.Bundle; import android.text.Html; import android.util.Log; import

TranslateAnimation on ImageView (Android)

好久不见. 提交于 2019-12-06 08:53:29
问题 So I have an ImageView in my layout and I wanted to slide it to the right or left when the user swipe over the latter. I used TranslateAnimation to translate the ImageView, as shown below. ImageView logoFocus = (ImageView) findViewById(R.id.logoFocus); Animation animSurprise2Movement = new TranslateAnimation(logoFocus.getLeft(), logoFocus.getLeft()+150, logoFocus.getTop(), logoFocus.getTop()); animSurprise2Movement.setDuration(1000); animSurprise2Movement.setFillAfter(true);

How to set selected area of Image to ImageView

孤人 提交于 2019-12-06 07:58:12
问题 I Was trying to set image to image imageview view from external storage and I done with that, but the thing is that it sets the whole image to imageview and I only want to set the selected square area from that image. Just life facebook provided functionality to set profile pic.. Can any one help me to do it?? Following is the sample what i want to do.. 回答1: Something like this: public static Bitmap cropBitmapToSquare(Bitmap bmp) { System.gc(); Bitmap result = null; int height = bmp.getHeight

setImageURI / setimagebitmap to fetch image from net and display in image view

萝らか妹 提交于 2019-12-06 07:37:46
I want to fetch image from net from some URL and show it in my ImageView. following is the code i am using :- Bitmap bm = null; try { URL aURL = new URL("stringURL"); URLConnection conn = aURL.openConnection(); conn.connect(); InputStream is = conn.getInputStream(); BufferedInputStream bis = new BufferedInputStream(is); bm = BitmapFactory.decodeStream(bis); bis.close(); is.close(); }catch (Exception e) { // TODO: handle exception } iv.setImageBitmap(bm); but i can not get the image I think the error is in URL aURL = new URL("stringURL"); should be without quotes URL aURL = new URL(stringURL);

Create Image from imageview and textview?

こ雲淡風輕ζ 提交于 2019-12-06 07:30:16
I'm making an app that will allow the user to add a photo to an imageview from the gallery of their phone which I have already been able to code successfully. I now want to be able to allow the user to add text on top of the photo and then save the text and image as one back into the gallery. Is there any way to do this? XML: <LinearLayout android:layout_height="match_parent" android:layout_width="match_parent" android:orientation="vertical" xmlns:android="http://schemas.android.com/apk/res/android"> <ImageView android:id="@+id/image" android:layout_height="400dp" android:layout_width="fill

Android ImageView topCrop/bottomCrop scaletype?

不羁岁月 提交于 2019-12-06 07:05:41
问题 I have a square ImageView which displays pictures of varying dimensions. I want to always maintain the original aspect ratio of the pictures and have no margin around the image (so that the image takes up the whole ImageView). For this, I am using the centerCrop scaleType on the ImageView . However, I want to make it so that if the top and bottom of the image are cut off (i.e.: the image is taller than it is wide), the image gets pulled towards the bottom of the container. So instead of