
Return CType((CardValue - suite) / 4, Face)Įnd Function Public ReadOnly Property FaceValue( ByVal CardValue As Byte) As Face ' The formula for card value is (card = face * 4 + Suit) Private Function CardFaceValue( ByVal CardValue As Byte, ByVal suite As Suit) As Face ' Method for returning face value based on raw card value. cdtDrawExt: Same as cdtDraw except this function allows you to specify the height and width of the card being drawn.Leave this value at zero, unless you are drawing a card back with the CrossHatch pattern. All other card backs and fronts are bitmaps, so setting this has no effect for any other card back. Clr: Sets the background color for the CrossHatch card back.Set this value to zero to draw the card face, and one to draw the card back. Type: Specifies to draw the face, back, or inverted face of the card.Either the face value of the card, or the value for the pattern to draw if drawing the card back. Y: The y-axis origin for the card image.X: The x-axis origin for the card image.hDC: The Handle for the object that the card image will be drawn on.This function takes the following arguments: cdtInit: This function initializes the cards library, and must be called first.ĭeclare Function cdtDraw Lib " cards.dll" ( ByVal hDC As IntPtr, ByVal x As Integer, _īyVal y As Integer, ByVal Card As Integer, _īyVal Type As Integer, ByVal clr As Integer) As Integer.Ĭards.dll exposes four functions and one sub routine. If you are not familiar with the cards library, I recommend you read Matt Pietrek's article on the subject.

There are many good articles on the net on how to use the Cards dynamic link library. This project uses the Cards.dll library to draw the playing cards. I really liked the interface he used, so I decided to code a modern version of his original FreeCell Game. It still works today on 32 bit Windows XP and Vista, but it is a 16 bit application, so it can't run on Vista or XP 64. Allen programmed and published one of the better FreeCell games available for Windows.

There are many good articles on the net on how to use the Cards dynamic link library, so I thought it would be fun to make my favorite one player card game, FreeCell.
