Drawing In an Android View
When I was drawing in a view using onDraw method, I noted that if you are drawing a line, the y scale starts at 1px but if you are drawing a text, the scale starts at height of text, i.e. The text have 10px height, you have to specify 10px at y position to display text at top of view. I think the android are drawing the text above the pixel scale. If you specify to draw the text at 1px, it will be drawed starting at -10px. Drawing a bitmap works fine, the top left of the image is x: 0px y: 0px You can test a lot of scales by putting the above code at onDraw event of a view: private void printScales(Canvas canvas){ Rect clipBounds = canvas.getClipBounds(); String clip_bounds = Integer.toString(clipBounds.right)+"x"+Integer.toString(clipBounds.bottom)+ " - "+Integer.toString(clipBounds.left) + "x" + Integer.toString(clipBounds.top); Log.i("clip bounds", clip_bounds); String canvas_string = Integer.toString(canvas.getWidth())...