android-image

Crop image as square with picasso

我的梦境 提交于 2019-12-02 04:06:26
问题 How can I crop image to square using picasso library on Android? I need following: cat one and cat two 回答1: The following project provides a lot of different transformations for Picasso https://github.com/wasabeef/picasso-transformations The one you are interested is named CropSquareTransformation and you can apply it by using the following code Picasso.with(mContext) .load(R.drawable.demo) .transform(transformation) .transform(new CropSquareTransformation()) .into(holder.image); You could

Crop image as square with picasso

▼魔方 西西 提交于 2019-12-02 00:40:41
How can I crop image to square using picasso library on Android? I need following: cat one and cat two The following project provides a lot of different transformations for Picasso https://github.com/wasabeef/picasso-transformations The one you are interested is named CropSquareTransformation and you can apply it by using the following code Picasso.with(mContext) .load(R.drawable.demo) .transform(transformation) .transform(new CropSquareTransformation()) .into(holder.image); You could add the dependency or copy and paste the classes you need. Using a custom imageview: public class

Fresco image loading callback

你。 提交于 2019-12-01 20:27:30
I have just migrated to the Fresco library for loading images in my app. I need to listen to Image Loading Events, of course I read this article in documentation Listening to download events This is exactly what I need, but.... There few things that I don't like. My goal is to hide View if it fails to download it from the net. I cannot reference SimpleDraweeView from controller, even on callback method. I need to hide View , but it seems that I cannot get reference to it. Each time I need to load image, I need to create object of controller using Builder , and this can cause performance issues

Using image from street view

坚强是说给别人听的谎言 提交于 2019-12-01 14:09:33
I want to get a picture of streetview (stating latitude and longitude) and display in a dialog, is this possible? I saw some examples here, but not found one that show me how to display the image in dialog. Sorry if already exists this question in the site, but I not found when I search. Yes you can, as a URL root you can use this one http://cbk0.google.com/ or maps.google.com and this is a example where you use above mentioned URL by providing location: http://cbk0.google.com/cbk?output=xml&hl=x-local&ll=34.058593,-118.240673&it=all The result should be: <panorama> <data_properties image

How proportionally scale any image (of imageview) with width equal to “match_parent”?

不打扰是莪最后的温柔 提交于 2019-12-01 01:36:50
I may have different drawables (large or small) and I always spans the width (match_parent) and increase or decrease the height proportionally. Maintaining the ratio. How is this possible? I tried with: <ImageView android:id="@+id/iv_TEST" android:layout_width="match_parent" android:layout_height="wrap_content" android:adjustViewBounds="true" android:scaleType="fitXY" android:src="@drawable/test" /> The problem is that it increases or decreases the width and it looks bad. ephramd Fixed. To correct this problem you need to do: Custom ImageView Set drawable to "android:src" , from code (

how can I save a bitmap with onRetainNonConfigurationInstance() for screen orientation?

蓝咒 提交于 2019-11-30 21:19:34
In my class view phone cam will be opened and programme shows the bitmap after user take photo from phone cam but at the same time the user rotates the screen to "landscape" bitmap will disappear and activity's oncreate() will load again and then camera will be opened again. I didnt know save bitmap with onRetainNonConfigurationInstance() or onSaveInstanceState(). The question is this how can I save the bitmap(taken from phone cam) before user rotates the phone so that even if phone is landscape mode same bitmap will be showed in the screen?? ---EDIT--- Adding to AndroidManifest.xml is a good

How proportionally scale any image (of imageview) with width equal to “match_parent”?

◇◆丶佛笑我妖孽 提交于 2019-11-30 20:25:19
问题 I may have different drawables (large or small) and I always spans the width (match_parent) and increase or decrease the height proportionally. Maintaining the ratio. How is this possible? I tried with: <ImageView android:id="@+id/iv_TEST" android:layout_width="match_parent" android:layout_height="wrap_content" android:adjustViewBounds="true" android:scaleType="fitXY" android:src="@drawable/test" /> The problem is that it increases or decreases the width and it looks bad. 回答1: Fixed. To

How to subsample/resize an image like in whatsapp

风格不统一 提交于 2019-11-30 16:43:44
When sending an image through whatsapp, you can see the image you are sending in an imageview scaled very very well for example, i sent two images to my friend size of first image : 1296 pixels X 2304 pixels size of second image : 1920 pixels X 1080 pixels this images are too big therefore whatsapp has to scale them before showing them to me in an imageview size of first image after being scaled by whatapp 333 pixels X 339 pixels size of second image after being scaled by whatsapp 333 pixels X 187 pixels As you can see the width is the same only height differs. i have tried to figure out how

How to subsample/resize an image like in whatsapp

那年仲夏 提交于 2019-11-30 14:25:06
问题 When sending an image through whatsapp, you can see the image you are sending in an imageview scaled very very well for example, i sent two images to my friend size of first image : 1296 pixels X 2304 pixels size of second image : 1920 pixels X 1080 pixels this images are too big therefore whatsapp has to scale them before showing them to me in an imageview size of first image after being scaled by whatapp 333 pixels X 339 pixels size of second image after being scaled by whatsapp 333 pixels

Android image sharpening, saturation, hue, brightness, and contrast

拥有回忆 提交于 2019-11-30 10:46:47
I'm trying to create an app that will allow me to adjust the hue, saturation, brightness, contrast, and sharpness of an image by adjusting the seekbars for each of the above fields. like at http://ronbigelow.com/articles/workflow_basic/hue-saturation_tool.jpg I have no idea how to do this and I can't find any tutorials online. Does Android have anything that does this already? Do I have to manipulate the colors of individual pixels? If I have to mess with the pixels, how would I do that? Yes, android has some tools for manipulating colors, some easier than others. The only way to do what you