imageview

Imageview set color filter to gradient

喜夏-厌秋 提交于 2019-11-28 20:09:38
问题 I have a white image that I'd like to color with a gradient. Instead of generating a bunch of images each colored with a specific gradient, I'd like to do this in code (not xml). To change an image's color, I use imageView.setColorFilter(Color.GREEN); And this works fine. But how can I apply a gradient color instead of a solid color? LinearGradient doesn't help, because setColorFilter can't be applied to Shader objects. EDIT : This is the image I have: This is what I want: And this is what I

Zoom and Panning ImageView Android

有些话、适合烂在心里 提交于 2019-11-28 19:40:28
I have created a zoom and pan class for an ImageView. Features I am trying to create. - It pans on single finger touch and movement - It zooms and pans on two finger touch and movement For the most part this works very well. It has a slight bug when I do the following: - I pan around with one finger (Status: No problem) - I put down a second finger, zoom and pan (Status: No problem) - I release my second finger (Status: The image jumps a little) Was hoping someone could help me solve this. I am thinking that it must have to do with resetting the mLastTouchX and mLastTouchY in "case MotionEvent

how to make full circular image view in android [duplicate]

◇◆丶佛笑我妖孽 提交于 2019-11-28 19:09:35
问题 This question already has answers here : Closed 6 years ago . Possible Duplicate: How to make an image fit into a circular frame in android I want a 360 degree circular shape Image View, I found related solutions on stackoverflow, but they were all yielding rounded corners in image view. But i want full circular image view. For rounded corners image view links are: Rounded corners in imageView How to make an ImageView with rounded corners? Any thoughts. 回答1: Get the Bitmap: Bitmap bitmap =

How to make my ImageView zoomable?

旧巷老猫 提交于 2019-11-28 19:01:12
Can anyone help on how to use the matrix scaletype to zoom an imageview and also how to use the translate method so that it can be focused at the center? I have tried using webview to be able to use the zooming and scrolling functionalities i needed but it is not nice to look at. I found a tutorial divided into 4 parts from a blog on how to zoom and pan an image and it is quite nice. It has sample codes that can be downloaded and some explanations. It also have other tutorials. Update - pointed the links to the new ones. Update 2 - I found a ready-to-use class for ImageView zooming

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

旧巷老猫 提交于 2019-11-28 18:33:51
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.java:1096) 03-02 23:14:10.514: E/AndroidRuntime(16736): at android.graphics.Bitmap.createBitmap(Bitmap

Changing bounds of imageView of UITableViewCell

不想你离开。 提交于 2019-11-28 18:27:37
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 setImage:image]; [holder.imageView setBounds:CGRectMake(0,0,75,75)]; [holder.imageView setFrame:CGRectMake

Core data images from desktop to iphone

♀尐吖头ヾ 提交于 2019-11-28 18:02:41
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]; if (cell == nil) { cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault

Show AlertDialog with ImageView without any padding

99封情书 提交于 2019-11-28 17:36:42
问题 EDIT - SOLUTION: I ended up figuring out a way to solve this issue. Because manually changing the height of the ImageView removes the extra padding, I ended up finding the dimensions of the original image, and apply them to the ImageView once the ImageView dimensions can be calculated. Here is the final result: This is the final working code: AlertDialog.Builder builder = new AlertDialog.Builder(this); builder.setPositiveButton("Get Pro", new DialogInterface.OnClickListener() { @Override

Android: resizing imageview in XML

允我心安 提交于 2019-11-28 17:26:05
I have an image that is too big to fit on the screen, i want it fairly small on screen. How do i change the size of the image through XML? i tried: <ImageView android:id="@+id/image" android:layout_width = "100dp" android:layout_height= "100dp" android:scaleType="center" android:layout_gravity="center_horizontal|bottom" android:src="@drawable/dashboard_rpm_bottom" > </ImageView> but the image isn't resized...it gets cropped. Any ideas? ameyume for example: <ImageView android:id="@+id/image_view" android:layout_width="wrap_content" android:layout_height="wrap_content" android:adjustViewBounds=

How to auto center crop ImageView Android?

孤者浪人 提交于 2019-11-28 17:24:14
I made a listView images. My goal that each item of my listView have the same height of 100dp. I encounter a problem that my imageView is resized automatically, but does not take the entire space of the parent. Here is my current result and objectif result : Does anyone know the option to add to make crop center automatically? I am not sure if I understood correctly. It must be either of the two, that you want, I guess. In your image view set the attribute android:scaleType="fitXY" to fit the ImageView completely. You can choose android:scaleType="centerCrop" to crop Center. Mehroz Munir i