Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7724699
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T04:45:15+00:00 2026-06-01T04:45:15+00:00

I am trying to make a blackjack game that teaches card counting. The visual

  • 0

I am trying to make a blackjack game that teaches card counting. The visual component is important so I have a mock up of a deck of cards and some code that copies each dealt card’s png file into a larger image to display the player and dealer’s hands. Unfortunately, every once in a while, my imagecopy is copying just a couple png’s without color (in grayscale). Here is the code for image creation, the rest of the code seems to be behaving flawlessly:

$cards = imagecreate( 360, 600 );

imagecopy( $cards, drawCard($dealershand[0]), 10, 10, 0, 0, 171, 254 );
imagecopy( $cards, @imagecreatefrompng("deckback.png"), 190, 10, 0, 0, 171, 254 );

imagecopy( $cards, drawCard($playershand[0]), 10, 336, 0, 0, 171, 254 );
imagecopy( $cards, drawCard($playershand[1]), 190, 336, 0, 0, 171, 254 );

If you need more code, just let me know and I can supply it but basically “drawCard” contains basically an if statement for red or black card and then a switch for the face value and outputs the @imagecreatefrompng( carddealt ), with card dealt file name generated inside as mocked up. $dealershand and $playershand are just arrays of two cards, each with a face and suit value.

Thanks and sorry if this is already answered.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T04:45:16+00:00Added an answer on June 1, 2026 at 4:45 am

    Try using imagecreatetruecolor instead of imagecreate.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to make a blackjack game where before each new round, the
I'm trying to make a Blackjack game in VB. What I'd like to do
Right now I'm trying make some browser based game. But I have little questions.
I'm trying to make a simple blackjack program. Sadly, I'm having problems right off
Trying to make a make generic select control that I can dynamically add elements
Trying to make a custom :confirm message for a rails form that returns data
Trying to make simple jQuery function to create a scrollToTop button that fades in
Trying to make infoWindows a little less uglier I found out that the infoWindows
trying to make one horizontal box.. inside that update limits. if u see the
Im trying to make an app that converts distance/area/volume using spinners as a unit

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.