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

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


你可能感兴趣的:(Android)