imageview

Null ImageView Reference

99封情书 提交于 2020-01-04 17:21:58
问题 I'm trying to get a reference to an ImageView object and for whatever reason, it keeps coming back as null. XML: <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="wrap_content" android:padding="6dip"> <ImageView android:id="@+id/application_icon" android:layout_width="wrap_content" android:layout_height="wrap_content" /> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:id

Android: Memory error because of an ImageView?

生来就可爱ヽ(ⅴ<●) 提交于 2020-01-04 16:25:06
问题 I have 2 activities Activity A = GameActivity uses an instance of PhotoTask.class which extends AsyncTask and is used to take and save picture. Once the picture is saved, I start Activity B = ShareActivity. When I take a picture and don't change the orientation, Activity B is called and everything works fine. Yet, if I change the orientation of the screen to take the picture (I pass from portait to landscape) I have errors when I take a picture (Activity B does not start). I even commented my

JavaFX SceneBuilder ImageView not working

南笙酒味 提交于 2020-01-04 13:38:40
问题 I need to create a GUI with SceneBuilder. I added an ImageView to my interface and set the path to my image correctly. The image is showing inside SceneBuilder, but when I run my application, the image is not there. I put the image inside "img/placeholder.png", and then directly into my root directory. Doesn't matter where I put it, it isn't working. The path to my gui.fxml file: /src/gui/gui.fxml The path to my image file: /placeholder.png Can anybody help me please? 回答1: Another solution in

JavaFX SceneBuilder ImageView not working

混江龙づ霸主 提交于 2020-01-04 13:38:28
问题 I need to create a GUI with SceneBuilder. I added an ImageView to my interface and set the path to my image correctly. The image is showing inside SceneBuilder, but when I run my application, the image is not there. I put the image inside "img/placeholder.png", and then directly into my root directory. Doesn't matter where I put it, it isn't working. The path to my gui.fxml file: /src/gui/gui.fxml The path to my image file: /placeholder.png Can anybody help me please? 回答1: Another solution in

How to disable anti-aliasing when scaling up an imageview in android?

会有一股神秘感。 提交于 2020-01-04 05:11:07
问题 I have a pixel art that I want to scale up. The problem is when I scale it up, it gets all blurred cause of the antialiasing. Is there a way to disable antialiasing directly from xml? 回答1: i hope its useful Bitmap bmpSource = BitmapFactory.decodeResource(getResources(), SourceFileId); //100 is dimension to resizing image size //Passing filter = false will result in a blocky, pixellated image. //Passing filter = true will give you smoother edges Bitmap bmpScaled = Bitmap.createScaledBitmap

Images disappear when scrolling up and down and spaces increase between images using Glide and RecyclerView

爷,独闯天下 提交于 2020-01-03 16:00:35
问题 I have a RecyclerView to display my images and I use Glide to load images from their URLs from my database in Firebase Storage. The problem is, when I scroll up and down, images reload and sometimes disappear and spaces between each image increase. How can I stop this? My RecyclerViewAdapter @Override public myViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { View row = LayoutInflater.from(parent.getContext()).inflate(R.layout.image_layout,parent,false); myViewHolder

Images disappear when scrolling up and down and spaces increase between images using Glide and RecyclerView

*爱你&永不变心* 提交于 2020-01-03 15:59:00
问题 I have a RecyclerView to display my images and I use Glide to load images from their URLs from my database in Firebase Storage. The problem is, when I scroll up and down, images reload and sometimes disappear and spaces between each image increase. How can I stop this? My RecyclerViewAdapter @Override public myViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { View row = LayoutInflater.from(parent.getContext()).inflate(R.layout.image_layout,parent,false); myViewHolder

ImageView setImageBitmap not working on certain devices

独自空忆成欢 提交于 2020-01-03 12:34:12
问题 I was practicing around with the Camera API for which I did the following: a. Setup a directory for the image captured (for startActivityForResult ) b. Setup the Bitmap so that the image could be shown once saved in the app itself. Here's the code for the following: Setting up the directory. private static File getOutputMediaFile(int type) { // External sdcard location File mediaStorageDir = new File( Environment .getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES), IMAGE

Padding in ImageView is not Working

做~自己de王妃 提交于 2020-01-03 07:32:21
问题 I want to make a screen which contains a top bar and an image. I use TextView for the top bar and ImageView for the image. I want to set padding only to the image view. My xml is given below. The padding action is not working. Can anybody explain why and what to do? <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@drawable

How to change the ImageView size at runtime within FrameLayout

喜欢而已 提交于 2020-01-03 05:54:10
问题 I have one ImageView inside FrameLayout. I am increasing the size of FrameLayout programmatically but ImageView size is not changing. I have set the ImageView paramas as MatchParent. Please Help me how to increase the size of image within frameLayout? here I have added the image into FrameLayout: img_pinch=new ImageView(getApplication()); img_pinch.setImageBitmap(m_bitmap); img_pinch.setLayoutParams(new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH