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

  • Home
  • SEARCH
  • 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 8801329
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T00:48:23+00:00 2026-06-14T00:48:23+00:00

I have a card game program that when a card gets discarded and is

  • 0

I have a card game program that when a card gets discarded and is found to be a certain type of card, it goes into my DefeatedChars pile, which is just a PictureBox named DefeatedChars. Currently all my images are loaded during runtime using ImageLocation which is the string of some website that stores all the card images. I want to know how to load this string to the PictureBox’s Image property so I can rotate it because trying to rotate gives me a null pointer exception because Image is nothing, at least I think that’s why. I do know through debugging that when DefeatedChars.Image is nothing. My question is, is there a way to rotate the ImageLocation after it’s been loaded or is there a way to move the image found at the ImageLocation into the image property. Ultimately, when I’m done with the game, I want the image found at the image location to be stored somewhere locally so that if the website changes, which it does, the cards will retain their images and properties, but that’s a question for later down the road. Here is the code I am stuck at that gives me a null pointer exception. I’m coding in Visual Studio.

DefeatedChars.ImageLocation = tempCard.ImageLocation
DefeatedChars.Image.RotateFlip(RotateFlipType.Rotate270FlipNone)

  • 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-14T00:48:25+00:00Added an answer on June 14, 2026 at 12:48 am

    I tried this…
    DefeatedChars.Image = Image.FromFile(tempCard.ImageLocation)
    But I ran into a “URI formats are not supported error”. Then I found this little gem on the internet, which replaces the first line of code above.

    DefeatedChars.Image = Image.FromStream(System.Net.HttpWebRequest.Create(tempCard.ImageLocation).GetResponse().GetResponseStream())

    It turns the URL into a stream so it can be used by the Image property and it works like a charm.

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

Sidebar

Related Questions

I am making a card game in ruby. I have the Game class, which
I have a card-game application which makes use of Single Table Inheritance. I have
I have a Rails 2.3.5 app which is serving a card game. I've been
I am trying to write a program to simulate a card game. I have
I have a small card game for Google+ which needs the visitor's name, avatar,
I have a small card game at Facebook (and few Russian social networks), which
I'm implementing a card game. In this game I have a Board that is
I have a card game that I am developing and need to load card
So I am writing a class that plays the card game war. I have
I have a simple card game (using 52 cards - no jokers) that I

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.