0

I want to draw a line (such as x axis) on a map on android. I write the following codes, but I still cannot see any thing except for the map. Is there any thing wrong with my codes? THX

protected void onCreate(Bundle savedInstanceState) {

       super.onCreate(savedInstanceState);

....
      Bitmap loadedBitmap = BitmapFactory.decodeResource(getResources(), R.drawable.map);
      Bitmap drawableBitmap = loadedBitmap.copy(Bitmap.Config.ARGB_8888, true);

      Canvas canvas = new Canvas(drawableBitmap);
      Paint paint = new Paint();
      paint.setColor(Color.BLACK);
      canvas.drawLine(0, 0, canvas.getWidth(), 0, paint);//draw x axis
....
}
QuickLearner
  • 89
  • 4
  • 12

0 Answers0