android 创建图片,[Android]创建图片

这篇博客介绍了Android开发中创建图片的过程,主要聚焦于Bitmap的创建方法,包括多种createBitmap函数的使用,并展示了如何利用Canvas进行图像操作,最后将Bitmap保存到文件并通知媒体库扫描。内容适合初学者,强调基础对于技术学习的重要性。
摘要由CSDN通过智能技术生成

Android开发中经常需要创建图片,而且从表现上来说,图片信息往往比文字信息更直观,更容易被人理解。所以创建图片的方法还是需要掌握的比较透彻,不应该像刚学Android开发一样——从别的地方复制过来再修改。

3a5a7afc3e46

虽然我就是刚入门

目前接触到的都是通过Bitmap生成图片文件,所以创建Bitmap就成为了工作的第一布。Bitmap的创建往往是通过createBitmap方法来实现。createBitmap方法有多种,根据传入参数来选择所需。其中有:

//Returns an immutable bitmap from the specified subset of the source bitmap.

createBitmap(Bitmap source, int x, int y, int width, int height)

//Returns a immutable bitmap with the specified width and height, with each pixel value set to the corresponding value in the colors array.

createBitmap(int[] colors, int width, int height, Bitmap.Config config)

//Returns an immutable bitmap from subset of the source bitmap, transformed by the optional matrix.

createBitmap(Bitmap source, int x, int y, int width, int height, Mat

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值