imageview

How to convert a Base64 string into a Bitmap image to show it in a ImageView?

拜拜、爱过 提交于 2019-11-25 23:25:14
问题 I have a Base64 String that represents a BitMap image. I need to transform that String into a BitMap image again to use it on a ImageView in my Android app How to do it? This is the code that I use to transform the image into the base64 String: //proceso de transformar la imagen BitMap en un String: //android:src=\"c:\\logo.png\" Resources r = this.getResources(); Bitmap bm = BitmapFactory.decodeResource(r, R.drawable.logo); ByteArrayOutputStream baos = new ByteArrayOutputStream(); bm

How to create a circular ImageView in Android? [duplicate]

穿精又带淫゛_ 提交于 2019-11-25 23:07:03
问题 This question already has answers here : How to make an ImageView with rounded corners? (46 answers) Closed 6 years ago . How could I create a rounded ImageView in Android? I have tried the following code, but it\'s not working fine. Code: Bitmap circleBitmap = Bitmap.createBitmap(bitmap.getWidth(), bitmap.getHeight(), Bitmap.Config.ARGB_8888); BitmapShader shader = new BitmapShader (bitmap, TileMode.CLAMP, TileMode.CLAMP); Paint paint = new Paint(); paint.setShader(shader); Canvas c = new

Android: Rotate image in imageview by an angle

烂漫一生 提交于 2019-11-25 22:46:04
问题 I am using the following code to rotate a image in ImageView by an angle. Is there any simpler and less complex method available. ImageView iv = (ImageView)findViewById(imageviewid); TextView tv = (TextView)findViewById(txtViewsid); Matrix mat = new Matrix(); Bitmap bMap = BitmapFactory.decodeResource(getResources(),imageid); mat.postRotate(Integer.parseInt(degree));===>angle to be rotated Bitmap bMapRotate = Bitmap.createBitmap(bMap, 0, 0,bMap.getWidth(),bMap.getHeight(), mat, true); iv

How can I get zoom functionality for images?

扶醉桌前 提交于 2019-11-25 22:26:54
问题 Is there a common way to show a big image and enable the user to zoom in and out and pan the image? Until now I found two ways: overwriting ImageView, that seems a little bit too much for such a common problem. using a webview but with less control over the overall layout etc. 回答1: UPDATE I've just given TouchImageView a new update. It now includes Double Tap Zoom and Fling in addition to Panning and Pinch Zoom. The code below is very dated. You can check out the github project to get the

How to make an ImageView with rounded corners?

﹥>﹥吖頭↗ 提交于 2019-11-25 21:44:21
问题 In Android, an ImageView is a rectangle by default. How can I make it a rounded rectangle (clip off all 4 corners of my Bitmap to be rounded rectangles) in the ImageView? 回答1: This is pretty late in response, but for anyone else that is looking for this, you can do the following code to manually round the corners of your images. http://www.ruibm.com/?p=184 This isn't my code, but I've used it and it's works wonderfully. I used it as a helper within an ImageHelper class and extended it just a