imageview

Get Bitmap from ImageView in Android L

♀尐吖头ヾ 提交于 2019-12-02 20:14:03
I want to get Bitmap from ImageView . I have used following code, but getDrawable() returns null. How to get whole Bitmap from ImageView . Bitmap bitmap; if (mImageViewer.getDrawable() instanceof BitmapDrawable) { bitmap = ((BitmapDrawable) mImageViewer.getDrawable()).getBitmap(); } else { Drawable d = mImageViewer.getDrawable(); bitmap = Bitmap.createBitmap(d.getIntrinsicWidth(), d.getIntrinsicHeight(), Bitmap.Config.ARGB_8888); Canvas canvas = new Canvas(bitmap); d.draw(canvas); } storeImage(bitmap,"final.jpeg"); Pankaj Arora Try this: imageView.invalidate(); BitmapDrawable drawable =

Javafx ListView with Images instead of Strings

人走茶凉 提交于 2019-12-02 20:14:02
问题 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();

Android loading images efficient (out of memory) [duplicate]

99封情书 提交于 2019-12-02 20:08:20
问题 This question already has answers here : Bitmap recycle with largeHeap enabled (5 answers) Closed 4 years ago . I just startet writing an app for Android. I have 3 activitys that use the same xml layout, an grid view. They also use all the same adapter to show an imageview and an textview in each grid item. When you select an object in the first activity, you get to the second and then to the third. First I used the normal method "imageView.setImageResource(drawableid)". It wasn't really a

PFImageView url displaying parse

烈酒焚心 提交于 2019-12-02 19:53:05
问题 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

Android imageview get pixel color from scaled image

北城以北 提交于 2019-12-02 19:48:49
My home automation app has a feature where people can upload images to their phone with floorplans and dashboards that they can use to control their home automation software. I have them upload two images: one visible image with the graphics that they want displayed, and a second color map with solid colors corresponding to the objects they want to target areas from the visible image. Both images have to be the same size, pixel-wise. When they tap the screen, I want to be able to get the color from the colormap overlay, and then I proceed to do what ever action has been associated with that

Text overlay over imageview in android

一曲冷凌霜 提交于 2019-12-02 19:35:28
I am trying to have textviews overlay over imageviews. Something like this Can someone help me with the code. Issac Balaji I had the same problem and solved it using a custom gridView. You must apply this in getView. Custom gridView XML: <?xml version="1.0" encoding="utf-8"?> <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/layout_practitioner" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" > <ImageView android:id="@+id/item_image" android:layout_width="match_parent" android:layout_height="match

How to size image to its original size

ぐ巨炮叔叔 提交于 2019-12-02 19:04:21
问题 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"

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

时光总嘲笑我的痴心妄想 提交于 2019-12-02 18:50:18
问题 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()

ImageView in android XML layout with layout_height=“wrap_content” has padding top & bottom

坚强是说给别人听的谎言 提交于 2019-12-02 18:42:15
I have a vertical LinearLayout containing an ImageView and a few other layouts and views. <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent"> <ImageView android:layout_width="match_parent" android:layout_height="wrap_content" android:contentDescription="@string/banner_alt" android:src="@drawable/banner_portrait" /> <TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:text="@string/main_search"

android 9-patch graphic doesn't scale in image view

点点圈 提交于 2019-12-02 18:36:56
I have <LinearLayout android:id="@+id/LinearLayout01" android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="horizontal"> <ImageView android:layout_height="wrap_content" android:layout_width="wrap_content" android:id="@+id/ImageView01" android:src="@drawable/phone80"></ImageView> <ImageView android:id="@+id/ImageView02" android:layout_height="wrap_content" android:src="@drawable/underline" android:layout_width="fill_parent" android:layout_gravity="fill_vertical|fill_horizontal"></ImageView> </LinearLayout> The first image is a fixed size image which