Blurry text over Canvas/Bitmap

Problems with Canvas, OpenGL, etc...

Blurry text over Canvas/Bitmap

Postby afail » Tue Nov 09, 2010 1:06 pm

Hi, I have this method (setText) that creates mTextBitmap with very ugly, blurry and bloated text on it. It is supposed to create nice and neat image with font on it. Any suggestions on where I might be wrong?

Code: Select all
public void setText(String string) {
   final Paint textPaint = new Paint();
   textPaint.setAntiAlias(true);      
   textPaint.setColor(Color.BLACK);
   textPaint.setTextSize(32);
   textPaint.setTypeface(Typeface.DEFAULT);
   final Bitmap textBitmap = Bitmap.createBitmap(256, 256, Bitmap.Config.ARGB_8888);
   Canvas textCanvas = new Canvas(textBitmap);
   textCanvas.drawText(string, 0, 128, textPaint);
   mTextBitmap = textBitmap;      
}
afail
Developer
Developer
 
Posts: 31
Joined: Sat Oct 02, 2010 8:43 pm

Top

Re: Blurry text over Canvas/Bitmap

Postby sampath_sl » Mon Nov 29, 2010 4:04 pm

Can you post a screen-shot of your output? Anti alias set to true would give a smudged text, if the font size is very small. Did you try setting anti alias false?

Code: Select all
textPaint.setAntiAlias(false);     
sampath_sl
Developer
Developer
 
Posts: 35
Joined: Sun Apr 11, 2010 4:45 pm
Location: Colombo

Top

Return to Android 2D/3D Graphics - OpenGL Problems

Who is online

Users browsing this forum: No registered users and 3 guests