【发布时间】:2012-09-08 13:55:04
【问题描述】:
我想从位图中删除像素。这是我的遍历位图中所有像素的 for 循环:
输入和输出都是位图。
for(int x = 0; x<input.getWidth(); x++){
for(int y = 0; y<input.getHeight(); y++){
if(output.getPixel(x, y) == input.getPixel(x, y)){
output.setPixel(x, y, Color.WHITE); // changes color to white
}
}
}
但我想删除像素,而不仅仅是改变它的颜色。那可能吗? 我稍后会根据其形状向该位图添加阴影,因此在这种情况下使其透明对我没有帮助。
【问题讨论】: