By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,573 Members | 1,777 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,573 IT Pros & Developers. It's quick & easy.

alpha blending...

P: n/a
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
Nov 20 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
* ":\\\\derian" <de****@someplace.com> scripsit:
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.

--
Herfried K. Wagner
MVP VB Classic, VB.NET
<http://www.mvps.org/dotnet>
Nov 20 '05 #2

P: n/a
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

":\\derian" <de****@someplace.com> wrote in message
news:uZ**************@TK2MSFTNGP12.phx.gbl...
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

Nov 20 '05 #3

P: n/a
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
":\\derian" <de****@someplace.com> wrote in message
news:uZ**************@TK2MSFTNGP12.phx.gbl...
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

Nov 20 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.