import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Path;
import android.graphics.Rect;
import android.graphics.RectF;
import android.graphics.drawable.ShapeDrawable;
import android.graphics.drawable.shapes.OvalShape;
import android.graphics.drawable.shapes.PathShape;
import android.graphics.drawable.shapes.RectShape;
import android.view.View;
/**
* @version 2012-8-10 上午10:25:09
**/
public class GameView extends View implements Runnable {
Paint mPaint = null;
GameView2 mGameView2 = null;
public GameView(Context context) {
super(context);
mPaint = new Paint();
mGameView2 = new GameView2(context);
new Thread(this).start();
}
@Override
public void run() {
// 判读该线程是否中断
while(!Thread.currentThread().isInterrupted()) {
try {
Thread.sle
绘制多边形
最新推荐文章于 2022-03-24 20:49:06 发布
本文介绍如何在Android中使用Canvas进行图形绘制,包括矩形、圆形、椭圆和多边形,以及如何使用ShapeDrawable绘制图形,并展示了相关代码示例。
摘要由CSDN通过智能技术生成