我要底紋從一種顏色逐漸另一個位圖(因此,如果它是怎麼回事,從沒有這麼紅煥發逐漸變得更紅。着色的位圖的另一種顏色
我每像素這樣做,但它會導致應用跳,可有人告訴我一個更有效的方法
private void adjustCountryBitmapColor()
{
//TODO Possible memory leak in this method.
mAllPixels = new int [ mCountryBitmap.getHeight()* mCountryBitmap.getWidth()];
mCountryBitmap.getPixels(mAllPixels, 0, mCountryBitmap.getWidth(), 0, 0, mCountryBitmap.getWidth(),mCountryBitmap.getHeight());
/*
int alpha=argb>>24;
int red=(argb & 0x00FF0000)>>16;
int green=(argb & 0x0000FF00)>>8;
int blue=(argb & 0x000000FF);
*/
for(int i =0; i< mCountryBitmap.getHeight()*mCountryBitmap.getWidth(); i++)
{
if(mAllPixels[i]>>24 == -1)
{
/*AllPixels[i] == Color.BLACK)
{
mAllPixels[i] = Color.RED;
}
*/
mAllPixels[i] = Color.RED;
}
}
System.out.println(mDeltaOffSet);
//int alpha = mAllPixels[0]>>24;
//System.out.println(alpha);
mCountryBitmap.setPixels(mAllPixels, 0, mCountryBitmap.getWidth(), 0, 0, mCountryBitmap.getWidth(), mCountryBitmap.getHeight());
}
沒有任何關於着色位圖的信息。 –
我希望這將幫助你.. http://stackoverflow.com/questions/4354939/understanding-the-use-of-colormatrix-and-colormatrixcolorfilter-to-modify-a-draw – Mahesh
@OllyDixon,看到我編輯的答案。 –