详解 Canvas.drawBitmap(Bitmap bitmap, Rect src, Rect dst, Paint paint)

来源:互联网 发布:淘宝网买剃须刀片 编辑:程序博客网 时间:2024/05/29 06:37

Canvas.drawBitmap(Bitmap bitmap, Rect src, Rect dst, Paint paint)

第一个参数是图片bitmap


第二个是对图片的裁剪 也就是说你想绘制图片的哪一部分

If the source rectangle is not null, it specifies the subset of the bitmap to draw.


第三个参数是该图片绘画的位置,就是你想把这张裁剪好的图片放在屏幕的什么位置上,比图片大,图片的等比拉伸,比图片小,就等比缩小

scaling/translating automatically to fill the destination rectangle


第四个是画笔Paint


0 0
原创粉丝点击