Computer Chess Club Archives


Search

Terms

Messages

Subject: Creating Draggable Chess Pieces In MFC Very Frustrating

Author: Eran

Date: 14:31:49 11/17/01



I program a chess window interface in MFC. After I successfully created
draggable chess pieces from bitmap resources, I had problems with the
transparency surrounding the chess pieces. When I called the function as show
below,

::TransparentBlt((HDC) &dc, org.x, org.y, size.x, size.x, (HDC) &dcMem,
		org.x, org.x, size.x, size.y, RGB(255, 255, 255));

the transparency looked fine if I never dragged them from their origin squares.
When I dragged a piece, the transparent region (a rectangle shape contains a
piece in center) surrounding it cut off from the area of the board and the
region followed the piece around like a shadow. That was a problem. Since I
could not find a solution in MFC, I dived into a more complicated Win32
programming codes in the WinBoard 4.2.3 source files.  I could not find it there
either. I tried with icons instead of bitmap resources but failed to show up on
client area of the View class. MFC is pretty inflexible.

If you know how to do it or if you have correct MFC codes (I prefer clear codes
with good explanations), please let me know.

I would appreciate your help a great deal.

My developing program is MS Visual C++ 6.0 Professional with latest update.

Thank you,
Eran
My new email address: eran_k1@bezeqint.net
Please do not email any message to my old email address (mrerk@barak-online.net)




This page took 0 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.