draw Line on Canvas - Android Graphics

Android examples for Graphics:Canvas

Description

draw Line on Canvas

Demo Code


import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.Rect;

public class Main{
    public static void drawLine(Canvas mcanvas, float startX, float startY,
            float stopX, float stopY, Paint paint) {
        mcanvas.drawLine(startX * GameView.screen_width
                / GameView.standard_width, startY * GameView.screen_height
                / GameView.standard_height, stopX * GameView.screen_width
                / GameView.standard_width, stopY * GameView.screen_height
                / GameView.standard_height, paint);
    }//from  w w w .j a  va 2 s  . c  o m
}

Related Tutorials