我有像素值的一维数组,我可以通过这种方式获得红色、绿色和蓝色。
int rgb[] = new int[]
{
(argb >> 16) & 0xff, //red
(argb >> 8) & 0xff, //green
(argb ) & 0xff //blue
};
我也知道我想要创建的图像的宽度高度。所以,我总共有以下数据。1)新图像的宽度 2)新图像的高度 3)像素值的一维数组。
我的主管建议我使用 createRaster 方法,但函数参数对我来说很难理解。你能给我一些简单的代码吗?谢谢。