Author: Tony Werten
Date: 00:28:39 11/18/01
Go up one level in this thread
On November 17, 2001 at 17:31:49, Eran wrote: A way that works. Paint the board on a memory bitmap, then paint the piece on it. Take x_now,y_now and x_prev and y_prev and calculate the rectangle that surrounds the pieces on both coordinates. Then copy this square to the screen. Should be quite flickerfree with todays hardware. Tony > >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.