Try drawing the text at 20, 20.

I think I had the same problem - not my computer to check right now.
If I remember correctly 0,0 is bottom left and the text is drawn off
the bottom of the bitmap.

Hope this helps

--
RichardC

On Oct 21, 9:51 am, Miguel Paraz <[email protected]> wrote:
> Hi,
> I want to use drawText() to draw a small piece of text in a bitmap.
> This is to overlay the text on an existing resource, as a numeric
> counter.
>
> In this code snippet, the drawColor() and drawCircle() work, but not
> the drawText().
> What am I missing? Thanks!
>
>                                 final Paint paint = new Paint();
>                                 paint.setColor(Color.YELLOW);
>                                 paint.setTextSize(12);
>                                 paint.setTypeface(Typeface.MONOSPACE);
>
>                                 final Bitmap bitmap = Bitmap.createBitmap(100,
>                                                 100, Bitmap.Config.ARGB_8888);
>                                 Canvas canvas = new Canvas(bitmap);
>
>                                 canvas.drawColor(Color.BLUE);
>                                 canvas.drawText("X", 0, 0, paint);
>                                 canvas.drawCircle(50, 50, 20, paint);
>
>                                 ((ImageView) 
> findViewById(R.id.pic)).setImageBitmap(bitmap);
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to