Creating chess graphics in Visual Basic - vb.net

I am creating a multiplayer chess game in Visual Basic.Net and I need to create tiles for the game.
Earlier, I used buttons for the tiles, but then I realized that not only did they look ugly, but the coding part also became a problem. Also, the images of the chess pieces didn't properly fit on the buttons and they became distorted. Also, shifting the image to a different button every time a move was played also became very inefficient.
So, in view of these difficulties, I want to build a proper board, but I have no idea where to start from or what controls to use for the design. Any suggestions?

A Chess Program using VB.NET : http://www.vbdotnetheaven.com/UploadFile/kaushalgol/ChessProgramInVB11142005235115PM/ChessProgramInVB.aspx
This was coded in VB6 : http://freesourcecodevisualbasic.blogspot.se/2011/07/source-code-2-player-chess.html

You don't wany to use controls for the pieces you should just draw the image directly onto your form. You then have full control of exactly where everything is drawn.
You need to hold some form of data structure that 'remembers' where all your pieces are.
Have a look at this link to GDI+ to help get you started

I would suggest it might be too complicated for a school project. Maybe if you reduce the scope - try for just human vs human.
Anyway,
The chess programming wiki
Bruce Moreland's old page on MinMax and other adversarial search algorithms
I have more links but i cant post any links anymore. It's limited to 2 links only. Im sorry.

Related

Vb.net HMI like graphic

i would like to make a very simple HMI where i use picturebox (no fancy ) as simple and link them together , the problem is that the pictures of symbols i use (although i use png with tranparent background ) when placed in a picturebox and needed to be on top of each others (in case for example a valve to be linked with a pipeline ) the picturebox on top will hide some of the other one's details and block it so it doesn't look like one piece and something is missed .
i don't know what i really can do exactly to get rid of that
any sugestions are more than welcome
thanks in advance
It will be hard to place an control with layerd, but a best way is to create a new shape (with gdi+ drawing) on the canvas, with that, you can layer it as you want.
You can use Qt or exd++ or Visual Basic.net

Template 10:Using MasterDetail along with Hamburger Template

I am using template 10 for developing a UWP app and i'm using hamburger template so when a user clicks on a particular category i would like to navigate him to a event list in a master detail view where on left is complete event list in that category and on right selected event details.There is a sample provided and its difficult to understand and don't know how to use the sample in my app along with hamburger navigation.Also as an extra feature if the user clicks on a particular category the hamburger panel should hide and masterdetail view of event should come.And when user click on back button the panel should appear again with that page.
If anyone could help me it would be of great help.Thanks in advance.
There is a really detailed sample in the repository. It has 2 examples in total. 1 a control being developed by a community member. The other is a design based around using basic XAML with visual states along with responsive triggers for screen sizing.
I've implemented the response non-usercontrol variant and it works very well. The other control based scenario has some good features and is being updated often for feature additions and corrections.
Master Detail Sample
I think what you might be looking for here is a slightly simpler thing that we are able to give you. Master/Detail is certainly not splitting the atom. That being said, it's not just a drag and drop thing either. Your are going to need to take a look at the sample. Try to reproduce it exactly into a blank project. It's a great resource, but it's not a control for you to use as much as a sample for you to refer to. I certainly wish I had a simpler answer for you, but this is going to take a little effort on your side to understand the mechanics and implement it. In the end, once you pass that "ah ha" moment, I think you will look back and realize it's simpler than you thought. But until you understand how it works at a fundamental level, it's just going to continue to confuse you. I agree with #mvermef that the visual-state approach (the primary approach) is the easiest and uses the skills you will want to learn for future development, too. But, to that end, please recognize there are TWO approaches in that sample. One uses view-states and the other uses a custom user control. If I were you, don't pick the second approach. The first approach will be easy to understand, easy to implement, and wonderfully helpful to understand for other things later down the road.

Position of PictureBoxes in form design window do not correspond to their position during runtime

EDIT: I realized that I didn't tag this properly - I should have included vb.net as a tag, on the grounds that there could be a code based solution. Note, that no changes to the resolution are made in my source code.
UPDATE: When the program starts execution, the left coordinate for each PictureBox is multiplied by ~0.376, whilst the top coordinate for each PictureBox.Top is multiplied by ~0.418 . This "down-scaling" applies to all picture boxes. The source code I have is incredibly rudimentary and cannot be responsible for this. I also looked at another project and I still face the same error. A simple but poor fix would be to divide each coordinate by the corresponding values mentioned above.
In order to show you the issue I'm facing, please look at the images below. Compare this image, where each PictureBox (i.e. a snake, set of arrows, etc.) has been placed so that they line up with a feature of the background image:
To this image, where the PictureBox elements are bunched together. Their positions have been "down-scaled" closer to the origin of the form (note that all the elements are transforming horizontally during runtime, which is why the elements are in the top right corner):
In the solution I was given (developed in VS 2010 I believe), the position of each PictureBox goes beyond the background image as shown:
It is clear that each picture box has been placed in an organized fashion. During execution, each PictureBox goes to it's intended position (i.e. lines up appropriately with the background image).
Obviously, the original developer of the solution I was given would have not faced the problem I am. The fact that the solution works properly during runtime indicates some kind of error with my instance(s) of VB. Does anyone know of any solutions?
I've came across this question which asks how to change the default resolution for a Windows 8 App and this question which asks why some applications appear differently on different machines, but they pose no clear solutions. I would appreciate any help, since it's holding me back from critical work I must do. Thank you in advance!
I feel a little silly now - I started carrying out a bit more research on VB forms and came came across this Microsoft documentation on form scaling. Realizing that my issue may have been caused by having this scaling automatically carried out, I then found the AutoScaleMode property of my form and changed it from Font to None, which resolved my problem.

adding animation to an access form - front end

I am Learning how to create dynamic Access Databases using VBA code and SQL. One of my big "pet peaves" is that the user interface is slick and very professional looking.
I am looking for some tecniques in cosmetic touch ups to make the user interface more professional looking. For example, i would like it so that when the user clicks on a button to activate a sub form which is hidden, that the form appears with a bit of "smoothed animation" such as and exploding transition-type effect instead of the standard hard visual appearance of the form which is the standard.
Any advice on what may be available will be very appreciated.
Thank you,
Andrew
This can not be done within Access, it's not designed for that. Access is a database application that comes packaged with Office. It's not going to provide any crazy out-of-the-box animation, it's just not meant for that. It's meant to be a very simple, stripped down database application.
It is somewhat feasable that you could create animations in a 3rd party app (such as Adobe AfterEffects) and have those animations run prior to the form opening, similar to how one would create motion menus for DVDs.
You could put a bunch of small animated graphics (like lights on a Christmas tree or tiny arrows) all around the sub-form and time it to display for a short while.

BitBlting with Windows Aero

For months now, I have been trying to solve a problem regarding rendering images properly onto Aero glass. From what I have gathered so far, to do this you need to render the graphics object as a bitmap, because the Aero requires an alpha channel. To be more specific, what I am trying to do is make a perfect, non-flicker text box ( and other controls). I do not want to fall back to rendering part of the form aero, as I may want more than one text box. Also, the DrawToBitmap function works, but is far too slow, which is why I want to accomplish this with BitBlt.
What I have right now, is the Graphics control of a TextBox, stored as a IntPtr. How do I take this graphics control, load it into a Bitmap, and draw that Bitmap with BitBlt? (or as the link suggests, fixing the alpha value of the Graphics object)
So my question is, is there anyway to do this with Visual Basic 2010 .NET?
If anyone can answer this question, provide input, or a equivalent alternative, I'd be very grateful.
Here is a link to a previous thread I have made, which describes the problem in much more detail:
http://social.msdn.microsoft.com/Forums/en-US/Vsexpressvb/thread/f0e9fa0c-9535-4cdb-826f-673ef58c408a
Best regards,
Jake M.
P. S.
This link has helped greatly, and addresses my problem. However the solution on the very last post seems to be what I am looking for, however I have no idea how to convert that into visual basic.
Aero: How to draw solid (opaque) colors on glass?