我有一個android應用程序,我需要從網站下載文本,將其轉換爲位圖格式並將其顯示在基於LED的顯示板上。在Android上將文本轉換爲位圖(像素)
我很努力的位圖轉換。
嘗試使用以下內容:
Bitmap mybitmap = Bitmap.createBitmap(100, 16, Bitmap.Config.ALPHA_8);
Canvas c = new Canvas(mybitmap);
c.drawText("0", 0, 0, paint);
但它似乎並不奏效。有什麼建議麼?
更新:
噴漆的對象初始化是這樣的:
Paint paint = new Paint();
paint.setStyle(Paint.Style.FILL);
paint.setColor(Color.RED);
paint.setTextSize(16);
paint.setAntiAlias(true);
paint.setTypeface(Typeface.MONOSPACE);
如何初始化你的繪畫對象? – slund 2011-05-26 16:57:21