Question

I am writing a quickie BlackJack Winforms app to demonstrate a couple of concepts. The engine itself is fairly simple, however, I'd like to display actual playing cards on the WinForm.

Is there a library out there that I can use (preferably free) that allows the display the cards.

There is, of course, the cards.dll from way back in the day, but it's unmanaged. Looking for something managed (or at least a managed wrapper around cards.dll).

Was it helpful?

Solution 4

There is also this lib which I have actually tested and seems to work great and has a great and easy to understand API.

http://www.c-sharpcorner.com/UploadFile/samersarhan/Cards.dllinWindowsControlLibray11232005050452AM/Cards.dllinWindowsControlLibray.aspx

OTHER TIPS

Not sure how good this is, but a quick search found PlayingCards on codeplex. It looks like you might be able to pull out the PlayingCardsLibrary project and use that. Or modify it as needed.

cards.dll used to be in windows, for supporting the built-in card games. There's a C# interface to it shown here. The author is displaying the cards face down, but a simple parameter change will show them face up. The dll may well still be in Windows, if not you can download it online.

Edit:

seems to have vanished from Vista, but like I said it's available from multiple sources online, or from an older MS operating system at a machine near you :-)

In the "Windows Presentation Foundation Unleashed" book you can see a example of how create a custom control that is a card. It's a good example but is WPF and not WinForms.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top