alpha blending...

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
 
H

Herfried K. Wagner [MVP]

* ":\\\\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.
 
R

Richard L Rosenheim

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
 
C

Crirus

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top