package com.example.viewex01;
import android.content.Context;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.RectF;
import android.graphics.Typeface;
import android.view.View;
public class MyView11 extends View {
Typeface typeface;
Paint paint;
public MyView11(Context context) {
super(context);
// TODO Auto-generated constructor stub
typeface = Typeface.createFromAsset(context.getAssets(), "balloons.ttf");
paint = new Paint(Paint.ANTI_ALIAS_FLAG);
paint.setTypeface(typeface);
}
@Override
public void onDraw(Canvas canvas) {
canvas.drawColor(Color.LTGRAY);
paint.setTextSize(30);
canvas.drawText("Hello World", 10, 50, paint);
}
}
'Android' 카테고리의 다른 글
셰이더 - 직선 그래디언트 LinearGradient (0) | 2013.03.29 |
---|---|
그리기 객체 - Path (0) | 2013.03.29 |
그리기 객체 - 택스트 Typeface (0) | 2013.03.29 |
그리기 객체 - 텍스트 (0) | 2013.03.29 |
그리기 객체 - Bitmap (0) | 2013.03.29 |