简体   繁体   中英

What is the best way to include cards images in my app?

I'm writing an android app in java and in one of my activities I want to use a pack of 52 cards, and display a few of them randomly. Do I need to download and keep 52 images or is there other way of doing it?

I want to display different cards, randomly chosen. How can I get those images?

I can think of 3 ways of doing this:

  1. Have a different image file for each card.
  2. Have one large image of all cards and only draw a part of the image for each card.
  3. Build the image of a card having several small images of the parts of a card.

If you're looking to save space on the device I would suggest number 3.

You would need images of the 4 suits, the faces(J,Q,K) and the blank card. The numbers and letters could simply be written in red and black.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM