Solved

Problem in moving a chess piece

Posted on 2004-09-09
10
206 Views
Last Modified: 2010-05-02
hi all. i am working
i am facingg a basic problem. how do we move pieces from one piece of board to another. i have taken 64 picture boxes to create. now when a player clicks on a picture box say p1 it starts moving with the mouse (Using the mouse move). picture box p1 changes it backcolor to match the picture box on which it is moving. when a user clicks on target picture box the moving picture box p1 is dropped here (after making sure that it is a valid move)

the problem is that when i move a piece, the whole picture box along with its border starts moving which does not look nice. if i had used image control for p1 instead of picture box, then whlie moving it goes back to the another picture box on which it is moving and piece on the image control cant be seen by the user.
any soloution...
i  wish to avoid API as much as possible.
waiting..
Thanks.
0
Comment
Question by:astudent
  • 3
  • 2
  • 2
  • +2
10 Comments
 
LVL 51

Expert Comment

by:Ryan Chong
ID: 12013979
Try not moving your image / picturebox controls around your chess board when you select and drop your piece, instead try set the source and destination pieces image instead..
0
 
LVL 6

Expert Comment

by:mmusante
ID: 12014384
You can change the mouse picture to the piece image while dragging ...
0
 
LVL 19

Accepted Solution

by:
arif_eqbal earned 150 total points
ID: 12014999
For each piece of your Chess figures keep an Icon file When Dragging starts from a PictureBox say P1 set the image of that picture box to empty so that the block P1 appears to be empty. Then set the MouseIcon to the Icon corresponding to the Image that was on the block P1. This will give an effect that the Chess Figure is being moved.

However you'll have to use manual dragging otherwise the PictureBox Boundry will alos appear in dragging, even that might not look too bad give it a try

0
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 

Expert Comment

by:DextroSoft
ID: 12016142
I'm not sure If I understand your question completely....

Do you want to crate an animation of a chess-piece without the drag-drop function the others were talking about ? Are we're talking about a function like this one: MoveCheckpiece(oldposition,newposition)  what will make the animation.

If so..I'm afraid that the built-in graphical capabilities for VB6 or not smooth enough. You better use the api-call "Bitblt"

But first, give more details about what it is exactly what you want so i can figure oit if Bitblt is a solution for you...

Regards,
0
 

Author Comment

by:astudent
ID: 12024635
Excellent  arif_eqbal  feedback  !!
but Sir, do you mean that first i need to make 12 icon files (.ico) 6 for black pieces and 6 for white pieces.
waiting..

0
 

Author Comment

by:astudent
ID: 12024648
... becuase i can use .gif files to set as mouse pointer.
0
 
LVL 19

Expert Comment

by:arif_eqbal
ID: 12024846
does not matter if you use .gif files
what I meant was you can have one set of dragging icon say a Grayed piece so that it looks a little different and the same could be used for both Black & White moves and it looks good also....


0
 

Author Comment

by:astudent
ID: 12033428
Hello  arif_eqbal  feedback !!
thanks for your reply.
but sir, i think we cant use .gif files as icon files. and i will have to create .ico or .cur files to be used as mouse icon. now i am looking for a software to convert .gif files into .ico or .cur files.
any suggestions  please.
thanks again.
A Student.
0
 
LVL 51

Expert Comment

by:Ryan Chong
ID: 12035241
>>now i am looking for a software to convert .gif files into .ico or .cur files.
Try use microangelo: http://www.microangelo.us
0
 
LVL 6

Expert Comment

by:mmusante
ID: 12041540
>>now i am looking for a software to convert .gif files into .ico or .cur
Iconedit Pro is also good ... http://www.iconedit.com/
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question