ImageView imageView = (ImageView) this.findViewById(R.id.imageView1);
// Bitmapの作成
Bitmap bitmap = Bitmap.createBitmap(500, 500, Bitmap.Config.ARGB_8888);
// Canvasの作成
Canvas canvas;
canvas = new Canvas(bitmap);
canvas.drawColor(Color.WHITE);
// Paintの作成
Paint paint;
paint = new Paint();
paint.setColor(Color.RED);
paint.setStyle(Style.FILL);
paint.setAntiAlias(true);
// キャンバスに円を描画する
canvas.drawCircle(100, 100, 10, paint);
canvas.drawText( "67.8", 90, 90, paint);
// ImageViewに作成したBitmapをセット
imageView.setImageBitmap(bitmap);
2013年3月12日火曜日
ImageViewに画像を作成して表示
関連記事
登録:
コメントの投稿 (Atom)

0 件のコメント:
コメントを投稿