¡@

Home 

2014/10/16 ¤W¤È 08:10:14

android Programming Glossary: arrowbitmap

How can I draw an Arrow showing the driving direction in MapView?

http://stackoverflow.com/questions/4331794/how-can-i-draw-an-arrow-showing-the-driving-direction-in-mapview

to add the functionality to rotate the Drawable. Something like public void rotateDrawable float angle Bitmap arrowBitmap BitmapFactory.decodeResource context.getResources R.drawable.map_pin Create blank bitmap of equal size Bitmap canvasBitmap.. context.getResources R.drawable.map_pin Create blank bitmap of equal size Bitmap canvasBitmap arrowBitmap.copy Bitmap.Config.ARGB_8888 true canvasBitmap.eraseColor 0x00000000 Create canvas Canvas canvas new Canvas canvasBitmap.. angle canvas.getWidth 2 canvas.getHeight 2 Draw bitmap onto canvas using matrix canvas.drawBitmap arrowBitmap rotateMatrix null return new BitmapDrawable canvasBitmap Then all that remains to be done is to apply this new Drawable..

How can I use a custom bitmap for the “you are here” point in a MyLocationOverlay?

http://stackoverflow.com/questions/753793/how-can-i-use-a-custom-bitmap-for-the-you-are-here-point-in-a-mylocationoverla

pixels Point screenPts mapView.getProjection .toPixels myLocation null create a rotated copy of the marker Bitmap arrowBitmap BitmapFactory.decodeResource mContext.getResources R.drawable.arrow_green Matrix matrix new Matrix matrix.postRotate mOrientation.. R.drawable.arrow_green Matrix matrix new Matrix matrix.postRotate mOrientation Bitmap rotatedBmp Bitmap.createBitmap arrowBitmap 0 0 arrowBitmap.getWidth arrowBitmap.getHeight matrix true add the rotated marker to the canvas canvas.drawBitmap rotatedBmp.. Matrix matrix new Matrix matrix.postRotate mOrientation Bitmap rotatedBmp Bitmap.createBitmap arrowBitmap 0 0 arrowBitmap.getWidth arrowBitmap.getHeight matrix true add the rotated marker to the canvas canvas.drawBitmap rotatedBmp screenPts.x..

BitmapDrawable deprecated alternative

http://stackoverflow.com/questions/9978884/bitmapdrawable-deprecated-alternative

will rotate a drawable by a set amount of degrees. public Drawable rotateDrawable float angle Context context Bitmap arrowBitmap BitmapFactory.decodeResource context.getResources R.drawable.generic2rb Create blank bitmap of equal size Bitmap canvasBitmap.. context.getResources R.drawable.generic2rb Create blank bitmap of equal size Bitmap canvasBitmap arrowBitmap.copy Bitmap.Config.ARGB_8888 true canvasBitmap.eraseColor 0x00000000 Create canvas Canvas canvas new Canvas canvasBitmap.. angle canvas.getWidth 2 canvas.getHeight 2 Draw bitmap onto canvas using matrix canvas.drawBitmap arrowBitmap rotateMatrix null return new BitmapDrawable canvasBitmap The new SDK says that the BitmapDrawable canvasBitmap is deprecated...