(Cross-posted from StackOverflow:
http://stackoverflow.com/questions/4485587/drawing-text-on-a-bitmap-rather-than-canvas)

Hi,

I am drawing some text on a Canvas, and on a Bitmap, respectively:

protected void onDraw(Canvas canvas) {
    canvas.drawText("Canvas text", 10, 10, mPaint);
    Canvas singleUseCanvas = new Canvas();
    singleUseCanvas.setBitmap(mBitmap);
    singleUseCanvas.drawText("Bitmap text", 10, 30, mPaint);
}

In the former case, the text renders as you would expect, while in the
latter, it appears very rough and ugly. This becomes even more
problematic when using e.g.

canvas.drawBitmapMesh(...);

to apply transformations to the bitmap. Am I doing something wrong, or
is the quality simply deteriorated when you pass from Canvas to
Bitmap?

On a side note, the reason why I'm drawing text on a Bitmap is to
obtain a "magnifier" effect on the text in question (like Apple OSX's
dock), since I can then apply arbitrary transformations to it using a
bitmap mesh. Is there another, perhaps better, way to do this?

Best,

Michael

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to