Marc, the cards.dat is a binary file created with B4PPC's binaryfile.dll. First, I assembled the bitmaps for each card and card back. Then I wrote a short program using the EmbedFile method to put all the bitmaps into a single file -- cards.dat.
As you can see from the CardDemo program, the images are retrieved using the RetrieveImage method. To retrieve a particular card image (bitmap), you need to know the starting position for that image within cards.dat. The CardDemo program gives you the algorithm for retrieving images 1-63, where images 1-52 are the cards in a standard deck, 53 is the joker, and 54-63 are different card backs.
All of the bitmaps are 96 x 71 pixels but the first 53 images have only 4 bits per pixel whereas the rest of the cards have 8 bits per pixel which means the storage space for those images is larger. This makes calculating the starting position a little more difficult but again, the algorithm for doing so is in the CardDemo program.
When you create an image control to receive the image with the RetrieveImage method, you should define its size in the same ratio as the original bitmap. The card demo program uses 96 x 71, 69 x 51, and 46 x 34, all of which have the same height to width ratio. Pick any height you wish and make the width proportional, or vice-versa.
As you can see in the carddemo program, the first card in cards.dat is the Ace of Clubs, followed by the 2 through the King. Then comes Diamonds in the same rank order, then Hearts and then Spades. It is easy enough to "shuffle" the 52 cards and deal a random hand. But you need a way of identifying the rank and suit of a give card (say, for example, card number 31). Here is the algorithm for doing that (be sure to define Rank and Suit as global):
Sub randcard(c)
Rank = 1 + (c-1) Mod 13
Suit = 1 + Int((c - 1) / 13)
End Sub
Rank returns a 1 for ace, 2-10, 11 = jack, 12 = queen, and 13 = king.
Suit returns 1 = clubs, 2 = diamonds, 3 = hearts, 4 = spades.
So if you enter the subroutine with C=31, you would get Rank = 5 and Suit = 3, i.e. the 5 of hearts.
I hope this enough information to get you going. Good luck with your project!
-Dave Fallen