目 录 【菜鸟教程】8.2.1 Bitmap(位图)全解析 Part 1 1.Android自定义控件 2.自定义控件其实很简单 3.Android Matrix 详解 4.android matrix 最全方法详解与进阶 5.Android动画 https://www.runoob.com/w3cnote/android-tutorial-bitmap2.html https://www.runoob.com/w3cnote/android-tutorial-drawable-tool.html 【菜鸟教程】8.3.2 绘图类实战示例 https://www.runoob.com/w3cnote/android-tutorial-bitmap-demo.html 【菜鸟教程】https://www.runoob.com/w3cnote/android-tutorial-canvas-api1.html
推荐网址
https://www.runoob.com/w3cnote/android-tutorial-bitmap1.html
https://blog.csdn.net/yuanheng19930119/article/details/88055225
https://blog.csdn.net/aigestudio/article/details/41212583?utm_medium=distribute.pc_relevant.none-task-blog-BlogCommendFromBaidu-2&depth_1-utm_source=distribute.pc_relevant.none-task-blog-BlogCommendFromBaidu-2
https://www.jianshu.com/p/5e30db034596
https://blog.csdn.net/cquwentao/article/details/51445269
https://blog.csdn.net/zhangbijun1230/article/details/80262359抠图片上的某一角下来
Bitmap bitmap1 = BitmapFactory.decodeResource(getResources(), R.mipmap.pic_meizi); Bitmap bitmap2 = Bitmap.createBitmap(bitmap1,100,100,200,200); img_bg = (ImageView) findViewById(R.id.img_bg); img_bg.setImageBitmap(bitmap2);
8.2.2 Bitmap引起的OOM问题
8.3.1 三个绘图工具类详解
画线条
/** * Created by Jay on 2015/10/15 0015. */ public class MyView extends View{ private Paint mPaint; //绘制线条的Path private Path mPath; //记录用户绘制的Path private Canvas mCanvas; //内存中创建的Canvas private Bitmap mBitmap; //缓存绘制的内容 private int mLastX; private int mLastY; public MyView(Context context) { super(context); init(); } public MyView(Context context, AttributeSet attrs) { super(context, attrs); init(); } public MyView(Context context, AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); init(); } private void init(){ mPath = new Path(); mPaint = new Paint(); //初始化画笔 mPaint.setColor(Color.GREEN); mPaint.setAntiAlias(true); mPaint.setDither(true); mPaint.setStyle(Paint.Style.STROKE); mPaint.setStrokeJoin(Paint.Join.ROUND); //结合处为圆角 mPaint.setStrokeCap(Paint.Cap.ROUND); // 设置转弯处为圆角 mPaint.setStrokeWidth(20); // 设置画笔宽度 } @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { super.onMeasure(widthMeasureSpec, heightMeasureSpec); int width = getMeasuredWidth(); int height = getMeasuredHeight(); // 初始化bitmap,Canvas mBitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888); mCanvas = new Canvas(mBitmap); } //重写该方法,在这里绘图 @Override protected void onDraw(Canvas canvas) { drawPath(); canvas.drawBitmap(mBitmap, 0, 0, null); } //绘制线条 private void drawPath(){ mCanvas.drawPath(mPath, mPaint); } @Override public boolean onTouchEvent(MotionEvent event) { int action = event.getAction(); int x = (int) event.getX(); int y = (int) event.getY(); switch (action) { case MotionEvent.ACTION_DOWN: mLastX = x; mLastY = y; mPath.moveTo(mLastX, mLastY); break; case MotionEvent.ACTION_MOVE: int dx = Math.abs(x - mLastX); int dy = Math.abs(y - mLastY); if (dx > 3 || dy > 3) mPath.lineTo(x, y); mLastX = x; mLastY = y; break; } invalidate(); return true; } }
8.3.16 Canvas API详解(Part 1)
1.translate(平移)
2.rotate(旋转)
3.scale(缩放)
4.skew(倾斜)
Android Matrix 详解
本网页所有视频内容由 imoviebox边看边下-网页视频下载, iurlBox网页地址收藏管理器 下载并得到。
ImovieBox网页视频下载器 下载地址: ImovieBox网页视频下载器-最新版本下载
本文章由: imapbox邮箱云存储,邮箱网盘,ImageBox 图片批量下载器,网页图片批量下载专家,网页图片批量下载器,获取到文章图片,imoviebox网页视频批量下载器,下载视频内容,为您提供.
阅读和此文章类似的: 全球云计算