Beispiel #1
0
        void drawCenter(string text, float yMultiply)
        {
            var r = new android.graphics.Rect();

            frameCanvas.getClipBounds(r);
            paint.setTextAlign(android.graphics.Paint.Align.LEFT);
            paint.getTextBounds(text, 0, text.Length, r);
            float x = frameWidth / 2f - r.width() / 2f - r.left;
            float y = frameHeight / 2f + (r.height() * yMultiply) / 2f - r.bottom;

            frameCanvas.drawText(text, x, y, paint);
        }