I have some code that is suppose to overlay a hexagonal game board "square" with another image (to represent an "on" state). Here is some of the code:
The important part is what I'm doing with the ReadPixel. I have the overlay image saved as a png file and thanks to an earlier post in a different topic, I had to add the
statement due to the alpha channel.
On my machine at home, this all works perfectly in that the color from the overlay image equal to the background does not get copied. But at work, my machine does not seem to handle this and I'm getting the entire overlay copied. I cannot install BB so I don't know exactly what is happening, and it has a low-end video card in it, but I don't know if that would make the difference or not? Otherwise, it seems to have no problem with PNG formats in general. Any ideas?
thanks...Dave
; ---------------------- ; composite image ; ---------------------- backColorHex% = GetRGB(BACKCOLOR_R, BACKCOLOR_G, BACKCOLOR_B) SetBuffer ImageBuffer(boardImg) LockBuffer For y = 0 To HEX_ON_IMG_HEIGHT - 1 For x = 0 To HEX_ON_IMG_WIDTH - 1 pixCol% = ReadPixel(x,y,ImageBuffer(imgToUse)) pixCol% = (pixCol% And $FFFFFF) If (pixCol <> backColorHex) Then CopyPixel x,y,ImageBuffer(imgToUse), _ (HEX_ON_START_X+bhx+x),(HEX_ON_START_Y+bhy+y),_ ImageBuffer(boardImg) EndIf Next Next UnlockBuffer
The important part is what I'm doing with the ReadPixel. I have the overlay image saved as a png file and thanks to an earlier post in a different topic, I had to add the
pixCol% = (pixCol% And $FFFFFF)
statement due to the alpha channel.
On my machine at home, this all works perfectly in that the color from the overlay image equal to the background does not get copied. But at work, my machine does not seem to handle this and I'm getting the entire overlay copied. I cannot install BB so I don't know exactly what is happening, and it has a low-end video card in it, but I don't know if that would make the difference or not? Otherwise, it seems to have no problem with PNG formats in general. Any ideas?
thanks...Dave