alpha blending...

  • Thread starter Thread starter :\\\\derian
  • Start date Start date
D

:\\\\derian

i designed a chess game using just vb.net. the chessboard has white and
brown squares. the chess pieces are gifs a grabbed from a random website...
they are square blocks with a white background and a colored piece. this is
all good and well when the chess pieces are on a white square b/c the
backgrounds blend but when a piece is moved to a brown square, the white
background sticks out like a sore thumb. How do i get the above image
(chess piece image) to blend in with the background image (chess board)

:\\derian
 
* ":\\\\derian said:
i designed a chess game using just vb.net. the chessboard has white and
brown squares. the chess pieces are gifs a grabbed from a random website...
they are square blocks with a white background and a colored piece. this is
all good and well when the chess pieces are on a white square b/c the
backgrounds blend but when a piece is moved to a brown square, the white
background sticks out like a sore thumb. How do i get the above image
(chess piece image) to blend in with the background image (chess board)

You will have to call the 'MakeTransparent' method for the bitmap
containing the chess piece image. Then you can use 'DrawImage' to draw
the image onto the board.
 
Another solution, which might give you better performance is to just have
two sets of bitmaps -- one for the pieces on white squares, and another for
when the piece is on a brown square.

Richard Rosenheim
 
Well, making background a unique color not found on the rest of the
pic(chess piece) and using MakeTransparent of Bitmap will solve your
problem.
Anyway I wander how can I blend a imiage using a greyscale mask, notonly one
color... tell me if halppend to find how
 
Back
Top