imageview

Difference between src and background for image view [duplicate]

醉酒当歌 提交于 2019-12-02 12:57:59
This question already has an answer here: What is the difference between src and background of ImageView 3 answers I have two imageviews. I have set background for one image view and I have set src for one image view . But both are looking differnt and also when i press the imageview with background set it is not showing the selection. can anyone explain why this happens ? <ImageButton android:layout_width="250dp" android:layout_height="100dp" android:background="@drawable/perm_group_camera"/> <ImageButton android:layout_width="250dp" android:layout_height="100dp" android:adjustViewBounds=

Android: placing an ImageView on an exact location on the screen

坚强是说给别人听的谎言 提交于 2019-12-02 12:55:45
I would like to use getLocationOnScreen to get the location of an ImageView, and then I would like to place another ImageView exactly at that place. Assume they both are in the same layout. When the app starts only imgv1 is visible. The user can move and rotate that image. Then the user can press a button and second image, imgv2 should be placed exactly on top of imgv1 so it covers it. Both imgv1 and imgv2 have the same size. For example, assume I have imgv1 and imgv2 as: ImageView imgv1, imgv2; int[] img_coordinates = new int[2]; imgv1.getLocationOnScreen(img_coordinates); I wanted to use

android change image onclick imageviev

戏子无情 提交于 2019-12-02 12:47:16
How can I change Image of an Imageview ? I want to get the image associated; if it is img1 I want set the image to img2 , if it is img2 I want to set the image to img2 . first set the tag of imageview in xml to 1 final ImageView imageview = (ImageView) findViewById(R.id.imageView1); imageview.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { if (Integer.parseInt(imageview.getTag().toString()) == 1) { imageview.setBackgroundResource(R.drawable.image2); imageview.setTag(2); } else { imageview.setBackgroundResource(R.drawable.image1); imageview.setTag(1); } } });

Picture taken from camera displayed in ImageView is always horizontal Android

限于喜欢 提交于 2019-12-02 11:13:59
问题 I am using the following code to take a picture and then display it on screen to the user using an ImageView. I want the picture to be displayed fullscreen (like on snapchat). However, the picture is always displayed like this horizontally with a white screen everywhere else: This is my layout: <FrameLayout 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" tools

Android: Draw text on ImageView with finger touch

≯℡__Kan透↙ 提交于 2019-12-02 11:11:01
问题 i completed the drawing text on ImageView and i saved the final image in sd card. My problem is, when i am touching the screen to draw the text, my image in the ImageView is disappearing. Code import java.io.File; import java.io.FileOutputStream; import android.net.Uri; import android.os.Bundle; import android.os.Environment; import android.os.StrictMode; import android.annotation.SuppressLint; import android.app.Activity; import android.content.Intent; import android.graphics.Bitmap; import

PFImageView url displaying parse

为君一笑 提交于 2019-12-02 10:56:18
It has been 1 week and I am still stuck on PFImageView. I remade everything. Changed from UITableView to PFQueryTableView, then tried to display image with UITableViewCell, then with PFTableViewCell and in every method only things that works to display are labels. Everytime when I run my app I get crash(SIGABRT) because of this line: ` Crashing line cell.imagevieww.file= [object objectForKey:@"ImageURL"]; [cell.imagevieww loadInBackground]; Can anyone help me to solve this problem? Thanks a lot TableViewController.h #import <Parse/Parse.h> #import "Customcell.h" #import "DetailViewController.h

imshow() displays a white image for a grey image

爱⌒轻易说出口 提交于 2019-12-02 10:54:39
问题 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? 回答1: 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

How to size image to its original size

感情迁移 提交于 2019-12-02 10:21:20
Android's imageView has a serious flaw: it makes my image into a square frame, with the rest as white space. How can I fix this? I have tried scale type, but it didn't work. Thank you. <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:paddingBottom="@dimen/activity_vertical_margin" android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin" android:paddingTop="@dimen/activity_vertical_margin

How to check whether the jigsaw puzzle is completed or not?

一个人想着一个人 提交于 2019-12-02 10:05:54
i am preparing one small game like jigsaw , for that i am using 9 imageview's with 9 different images in the layout. set the images to imageview at the time of starting those are actual images, after shuffle user will do sliding the images to complete puzzle, i want to check the modified image with actual image's, weather it's equal or not if those are equal popup a message, like gameover. i tried like this 1.by using AND operator between the images(Drawables) but unlucky. 2.Using setLevel() for the images, compare those setLevel values with getLevel values for images after sliding still

Javafx ListView with Images instead of Strings

烂漫一生 提交于 2019-12-02 09:54:58
I am trying to make a banner in my programm with movie pictures, but I'm having troubles to turn the List I have with the urls of images to actual Images. How can I do this, here is my current code: public void initData(boolean onlineProvider, String uritext) { op = Providers.createTestProvider(); List<Movie> films = (List<Movie>) op.getMovieDAO().listFiltered(); ObservableList<String> posters = FXCollections.observableArrayList(); for( Movie movie : films){ String poster = movie.getPoster(); posters.add(poster); } banner.setOrientation(Orientation.HORIZONTAL); banner.setItems(posters); } } To