I want to find out all pixels which are white color in a bitmap,and change their color to 0x00ff00ff.I use these codes as below,but I still cant change their color.I dont konw why.
TUint32* piaddress = iBitmaptest->DataAddress();
TSize tsize = iBitmaptest->SizeInPixels();
TBitmapUtil bitmaptestutil(iBitmaptest);
bitmaptestutil.Begin(TPoint(0,0));
TInt xPos,yPos;
for(yPos=0;yPos<tsize.iHeight;yPos++)
{
bitmaptestutil.SetPos(TPoint(0,yPos));
for(xPos=0;xPos<tsize.iWidth;xPos++)
{
if(0x00ffffff==bitmaptestutil.GetPixel())
{
bitmaptestutil.SetPixel(0x00ff00ff); bitmaptestutil.IncXPos();
bitmaptestutil.IncXPos();
every time after inner loop:
for(xPos=0;xPos<tsize.iWidth;xPos++)
{
}
my position stays in the first pixel in the line.but in the inner loop
i use "bitmaptestutil.IncXPos();"so the position move from the first
pixel to the end in the line.
otherwise,do you know how to get the pixel color and change the color,you can use any solution.
Thank you
my mistake, didn't notice that line... anyway I used very similar code in one of my apps and it worked as it should. Basically I was using the Set pos for each pixel, but I quess the inc should work as well.
another question is that I dont know what value the GetPixel() return.what a white pixel should return?I use GetPixel () to get a
white bitmap pixel.but it return value 3137.