Solved

Problem in moving a chess piece

Posted on 2004-09-09
10
202 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 49

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
 

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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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 49

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

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.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

910 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now