Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Random Bitmaps

Status
Not open for further replies.

EyesAllAfire

Programmer
Joined
Apr 10, 2002
Messages
5
Location
US
I am trying to make a card game and I can't seem to figure out how to make random bitmaps appear. Any ideas?
 
By random bitmaps, i assume that you have 52 pre-defined bitmaps? If so, you can

1. make an array of cbitmaps
2. Generate a random number between 0 and 51
3. Load that bitmap

CBitmap::LoadBitmap(RESOURCE_ID) should work fine

Or you can load the bitmap into a picture control if the cards are in a fixed position.

Matt
 
Hmm. That seems so simple lol. Thanks I will go for the array thing, I shouldn't be fixing games of 21 just yet...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top