---
title: "Android bitmap with border"  
description: "Android bitmap with border"  
author: "Anonymous User"  
published: 2013-05-29  
updated: 2013-05-30  
canonical: https://www.mindstick.com/forum/937/android-bitmap-with-border  
category: "android"  
tags: ["android"]  
reading_time: 2 minutes  

---

# Android bitmap with border

Hi Guys,\
I have this [function](https://www.mindstick.com/articles/13001/multi-statement-table-valued-user-defined-function-in-sql-server), with this function I can show an [image](https://www.mindstick.com/articles/23551/an-investigate-distinctive-seafood-restaurant-for-your-image-stamp-character) with a little rotation. I'm [trying](https://answers.mindstick.com/qa/93698/6-mistakes-couples-are-trying-to-save-money) to display a white border arround the [bitmap](https://www.mindstick.com/forum/1924/find-image-format-using-bitmap-object-in-c-sharp).

```
Matrix m = new Matrix();        m.postRotate( rotation, center.x, center.y );        m.postTranslate( ( position.x - center.x ) - xOffset , position.y - ( center.x ) );        //  set the current position to the updated position        positionMatrix.set( m );                    renderAnimation();                  c.drawBitmap( this.bitmap , positionMatrix, paint );
```

\
I'm trying to [add](https://www.mindstick.com/forum/12983/add-address-in-textbox-when-page-is-load-and-if-i-search-address-in-textbox-show-in-map-by-javascript) the white border with this function: [reference](https://www.mindstick.com/forum/774/reference-what-does-this-error-mean-in-php): stackoverflow border\
RectF targetRect = new RectF([left](https://www.mindstick.com/articles/12768/don-t-be-left-behind-with-the-new-it-revolution)+10, top+10, left + scaledWidth, top + scaledHeight); Bitmap dest = Bitmap.createBitmap(this.bitmap.getWith() +20, this.bitmap.getHeight() +20, this.bitmap.getConfig()); [Canvas](https://www.mindstick.com/forum/1383/how-can-i-print-a-canvas-in-wpf) canvas = new Canvas(dest); canvas.drawColor(Color.WHITE); canvas.drawBitmap(this.bitmap, [null](https://www.mindstick.com/forum/33922/how-to-use-null-coalescing-operator-in-c-sharp), targetRect, null);c.drawBitmap( this.bitmap , positionMatrix, [paint](https://www.mindstick.com/forum/161444/fid-is-being-replaced-by-inp-what-is-inp-interaction-to-next-paint) );But, not works, can some help me.\
**Thanks**

## Replies

### Reply by AVADHESH PATEL

Hi Pravesh!\
Try this, maybe you made a mistake when calculating the side:\
**c.drawBitmap( this.bitmap , positionMatrix, paint );****canvas.drawBitmap(this.bitmap, null, targetRect, null);**\
I hope this code might be resolve your problem.


---

Original Source: https://www.mindstick.com/forum/937/android-bitmap-with-border

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
