imageview

Android: Drawing a canvas to an ImageView

拟墨画扇 提交于 2019-11-27 12:39:09
I'm new to android programming and what I'm trying to figure out is this; In my layout i have a TextView, ImageView, and Button, all on a vertically oriented LinearLayout. I want to be able to dynamically draw circles in the ImageView, without disturbing the rest of my layout(textview/button). I'm trying to create a canvas, and use the drawcircle function within canvas to set the location of the circle. And then draw that canvas to my imageview in some way. I cannot get this to work, is there a trick to this? Or is my method fundamentally wrong? How would i go about drawing circles to the

Can't use srcCompat for ImageViews in android

不打扰是莪最后的温柔 提交于 2019-11-27 12:34:41
I'm using the Design Support Library 23.2. I've added these lines in my build.gradle as my Gradle Plugin is version 1.5 defaultConfig { applicationId "com.abc.xyz" minSdkVersion 16 targetSdkVersion 23 versionCode 1 versionName "1.0" generatedDensities = [] } aaptOptions { additionalParameters "--no-version-vectors" } } as it's specified in here But I can't use the srcCompat attribute for my imageview. <ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" android:srcCompat="@drawable/wallpaper"/> where @drawable/wallpaper is a vector resource file <vector xmlns

How to prevent onClick method on transparent portion of a PNG-loaded ImageView

百般思念 提交于 2019-11-27 12:11:51
I am currently developing an Android app that displays multiple images (as ImageView's ) stacked on top of each other. Here is how the layers are currently configured: Background layer: scales the entire screen, must be clickable Foreground layer: scales the entire screen, must be clickable, contains transparency which allows the user to see some of the background layer The problem I face is with the foreground layer. I am assigning the onClick() method to the imageview, but the method is being called whether they hit the portion of the image which is visible as well as the part which contains

ImageView displaying in layout but not on actual device

*爱你&永不变心* 提交于 2019-11-27 12:00:06
问题 I have an ImageView that I want to display matching the full width of the device, I realized that like this: <ImageView android:id="@+id/home_bar_newvault" android:layout_width="wrap_content" android:layout_height="40dp" android:scaleType="centerCrop" android:layout_alignParentBottom="true" android:src="@drawable/home_bar" /> The home_bar is a PNG image file with the following dimensions: 2399x254. When I choose to view the Graphical Layout of the UI it displays the imageview correctly at the

ImageView rounded corners

∥☆過路亽.° 提交于 2019-11-27 11:48:31
I wanted image to have rounded corners. I implement this xml code and use this in my image view. but image overlap the shape. I am downloading the image through async task. <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" > <corners android:radius="20dip" /> </shape> <ImageView android:id="@+id/trVouchersImage" android:layout_width="55dp" android:layout_height="55dp" android:layout_marginLeft="8dp" android:layout_centerVertical="true" android:layout_centerHorizontal="true" android:layout_alignParentLeft="true"

What is the best way to display millions of images in Java?

我们两清 提交于 2019-11-27 11:43:06
You see that ? Each brick of each house is an image of 16x16 pixels. What you can see here a version based on simple JavaFX, with some Imageview moved on X and Y to give the effect of "construction". I just adapt this to Swing using paintComponent . The problem: - With JavaFX: my computer has trouble. What you see on the picture took 2 seconds to load and it is then moving very slow and jerky. - With Swing : I do not know how to adapt each block according to brightness, shadows, etc.. So it looks like this: What method should I chose? Both have major drawbacks. I would have liked to keep the

Canvas: trying to use a recycled bitmap android.graphics.Bitmap in Android

走远了吗. 提交于 2019-11-27 11:27:43
问题 I am working on the crop image class, but encounter a recycled bit map problem: 03-02 23:14:10.514: E/AndroidRuntime(16736): FATAL EXCEPTION: Thread-1470 03-02 23:14:10.514: E/AndroidRuntime(16736): java.lang.RuntimeException: Canvas: trying to use a recycled bitmap android.graphics.Bitmap@428e5450 03-02 23:14:10.514: E/AndroidRuntime(16736): at android.graphics.Canvas.throwIfRecycled(Canvas.java:1026) 03-02 23:14:10.514: E/AndroidRuntime(16736): at android.graphics.Canvas.drawBitmap(Canvas

Changing bounds of imageView of UITableViewCell

元气小坏坏 提交于 2019-11-27 11:22:22
问题 I'm trying to place various size images inside imageView of UITableViewCell. I get the image data asynch'ly, create the image, set the content mode of imageView and finally set bounds of imageView. But the code seems insensitive to any changes I made. I want the images to be centered in a 75x75 area. I wrote the below code for this purpose UIImage* image = [UIImage imageWithData:data]; [holder.imageView setContentMode:UIViewContentModeCenter || UIViewContentModeRedraw]; [holder.imageView

Core data images from desktop to iphone

大城市里の小女人 提交于 2019-11-27 11:00:21
问题 I built a simple mac data entry tool I use with an iPhone application. I've recently added thumbnail which I added via an Image Well using simple bindings. Its a transformable data type which seems to work fine. The iPhone application however won't show the images. The attribute isn't null but I can't get an image to appear. The following is for cellForRowAtIndexPath static NSString *CellIdentifier = @"Cell"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]

Android imageview not respecting maxWidth?

杀马特。学长 韩版系。学妹 提交于 2019-11-27 10:58:58
So, I have an imageview that should display an arbitrary image, a profile picture downloaded from the internet. I want this the ImageView to scale its image to fit inside the height of the parent container, and a set max width of 60dip. However, if the image is tall ratio-wise, and doesn't need the full 60dip of width, the ImageView's width should decrease so the view's background fits snugly around the image. I tried this, <ImageView android:id="@+id/menu_profile_picture" android:layout_width="wrap_content" android:maxWidth="60dip" android:layout_height="fill_parent" android:layout_marginLeft