I'm drawing text to a canvas, but the text is not rendered properly
into the bitmap. I create a GL Texture and render it to the screen
with a full-screen quad. This is the result: http://i56.tinypic.com/259lthw.png

Here's the code I'm using:

Bitmap me = Bitmap.createBitmap(320, 80, Bitmap.Config.ARGB_8888);
Canvas canvas = new Canvas(me);
me.eraseColor(0);
Paint p = new Paint();
p.setTextSize(16);
p.setColor(Color.BLUE);
canvas.drawText("ABCDEFGHIJKLMNOPQRSTUVWXYZ", 0, 30, p);

Then I create the texture with:

int[] textureHolder = new int[1];

gl.glGenTextures(1, textureHolder, 0);
textureID = textureHolder[0];
gl.glBindTexture(GL10.GL_TEXTURE_2D, textureID);
GLUtils.texImage2D(GL10.GL_TEXTURE_2D, 0, me, 0);

me.recycle();

If i use a shorter string like "123", nothing shows up. If i set the
coords to 0, 0, barely anything shows up. Does anyone have any idea
what i could be doing wrong?

-- 
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