imageview

Moving an image through a linearlayout

纵然是瞬间 提交于 2019-12-02 07:24:05
I'm developing an Android 2.2 application. I want to move an image from left side of the screen to the right side of the screen. How can I do that? I've read that I have to add this image to a ListView or to a GridView to setup this animation. UPDATE I've created the following files: anim/translate_right <?xml version="1.0" encoding="utf-8"?> <set xmlns:android="http://schemas.android.com/apk/res/android" android:interpolator="@android:anim/accelerate_decelerate_interpolator"> <translate android:fromXDelta="-100%p" android:toXDelta="0" android:duration="5000" /> </set> anim/ship_layout

Get Image from Url Unable to Decode Stream: fileNotFoundException

三世轮回 提交于 2019-12-02 07:06:27
I know this issue as been ask many times but i've tried many solutions and no one works. On Android, I'm trying to get an image from URL to put it in an image view. Unfortunately, I get the following error : E/BitmapFactory: Unable to decode stream: java.io.FileNotFoundException: http:/lorempixel.com/1920/1920/business (No such file or directory) When I try to reach this URL from the browser of the emulator, it works. I've already tried the following solutions : Load image from url How to get image from url website in imageview in android how to set image from url for imageView My actual code

Difference between View and ImageView when outputting an image

拥有回忆 提交于 2019-12-02 07:01:56
问题 When I output the image,I use View: View.setbackgroundResource() instead of ImageView: ImageView.setImageDrawable(drawable) I was wondering if there was a big difference? 回答1: Of course there is a difference. In the first one, you are modifying the BACKGROUND of a certain View. In the second one, you are modifying the CONTENT (which is an Image) of a certain ImageView. It might seem the same thing if the ImageView is inside (or over) the other View and if they have the same size, but usually,

JavaFX - get index row and index col by OnClick on GridPane [duplicate]

只愿长相守 提交于 2019-12-02 06:27:42
This question already has an answer here: Javafx - Determine position of cursor on right click relative to gridpane 1 answer How to get GridPane Row and Column IDs on Mouse Entered in each cell of Grid in JavaFX? 1 answer JavaFX : How to get column and row index in gridpane? 1 answer I need to get the index of my specified click over my GridPane called myGrid. If I put a piece on board from my coord like here below, it works.. for example: myGrid.add(new ImageView("othello/images/white.png"), 4, 3); If I want to take the position of my click on board I use this method without success.. @FXML

imshow() displays a white image for a grey image

梦想与她 提交于 2019-12-02 06:08:03
I have computed an image with values between 0 and 255. When I use imageview(), the image is correctly displayed, in grey levels, but when I want to save this image or display it with imshow, I have a white image, or sometimes some black pixels here and there: Whereas with imageview(): Can some one help me? Matlab expects images of type double to be in the 0..1 range and images that are uint8 in the 0..255 range. You can convert the range yourself (but change values in the process), do an explicit cast (and potentially loose precision) or instruct Matlab to use the minimum and maximum value

Simple ImageView color animation

人走茶凉 提交于 2019-12-02 05:03:30
问题 Hi I am relatively new to Android, and I would like, if possible, some guidelines or suggestions on where to search in order to solve my issue. Apparently, I do not possess the reputation to post images, therefore I'll try to explain it as well as i can. Let's say I have an empty bottle, and once this fragment/activity is called i want to introduce an animation that will gradually and vertically (from bottom to top) start filling this imageView with water. Any thoughts or directions, Thanks a

Set the background image in blur effect in android app

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-02 04:56:20
问题 Im trying to get my background image on the list view blurred, but I tried following the tutorials and it does not work. Anyone please advise, thanks. main activity.java public class IngredientCategoryMain extends Activity { ListView list; String[] title; CategoryImageAdapter adapter; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_ingredient_category_main); list=(ListView)findViewById(R.id.listView); title =

Android OutOfMemory Issue [closed]

断了今生、忘了曾经 提交于 2019-12-02 04:46:17
i face outofmemory issue in my app and after some search, I found out this code //decodes image and scales it to reduce memory consumption private Bitmap decodeFile(File f){ try { //Decode image size BitmapFactory.Options o = new BitmapFactory.Options(); o.inJustDecodeBounds = true; BitmapFactory.decodeStream(new FileInputStream(f),null,o); //The new size we want to scale to final int REQUIRED_SIZE=70; //Find the correct scale value. It should be the power of 2. int scale=1; while(o.outWidth/scale/2>=REQUIRED_SIZE && o.outHeight/scale/2>=REQUIRED_SIZE) scale*=2; //Decode with inSampleSize

App crashing after adding a ScrollView and ImageView

旧巷老猫 提交于 2019-12-02 04:37:12
I added a scroll element to the main activity of my application along with an ImageView but when I ran the project on an emulator it crashes giving me errors stemming from the main activity.The error log is a follows: http://pastebin.com/PAYrjHCL So from going through the errors I found that it was a problem in the main activity.But I don't see where I have gone wrong as I only added these two features.Can anyone spot whats wrong in this activity thats causing it to crash? My main_activity is like this: <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http:/

Get drawable displayed size after scaling

佐手、 提交于 2019-12-02 04:31:38
here's my problem: How can get the displayed size of the drawable inside an ImageView in pixel after scalling, assuming that the ImageView size isn't equal to the scaled drawable? A lot of methods just return the original size of the Drawable or just the size of the ImageView. Here is a picture describing what I want : http://image.noelshack.com/fichiers/2013/06/1360144144-sans-titre.png 1 --> ImageView Size 2 --> The scaled image size that I want to get in px Thank you. From the image you posted I assume you have scaleType of FIT_CENTER (or CENTER_INSIDE with drawable bigger than imageView)