在 Android 中存储位图
我正在操纵位图中的像素值。 在Android中程序的特定运行中 红绿蓝的源值为 45 13 0 操作这些值后,值是红绿蓝 44 9 7
现在我从这些像素值创建一个新的位图,并使用它存储它
Bitmap.compress(Bitmap.compress.PNG,100,fout);
并使用它访问像素。
bmp.getPixel(0,0,value);
红绿和蓝的新值是 49 16 0,这都不是操纵的值也不是原始值,我的代码可能有什么问题?
I am manipulating the values of pixels in a bitmap.
In a particular run of the program in Android
The source values of Red Green and Blue were 45 13 0
After manipulating the values the values were Red Green Blue 44 9 7
Now i create a new bitmap from these pixel values and store it using
Bitmap.compress(Bitmap.compress.PNG,100,fout);
and access the pixel back using
bmp.getPixel(0,0,value);
The new values of Red Green and Blue were 49 16 0 which is neither the manipulated value nor the original value,What may be wrong with my code?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
位图
compress
函数压缩位图文件。使用 Bitmapfactory 解码资源,您将得到实际的位图。
The bitmap
compress
function compresses the bitmap file.Use
Bitmapfactory
to decode the resource and you will get back actual bitmap.