Jump to content

  • Log In with Google      Sign In   
  • Create Account

14 years ago on June 15th Gamedev.net was first launched! We want to thank all of you for being part of our community and hope the best years are ahead of us. Happy birthday Gamedev.net!

#ActualKuam

Posted 16 June 2012 - 03:26 PM

I'm having trouble drawing images in my program. It is not a variable problem or syntax problem so I'm a little lost.

To clarify, this is in XNA.

I've added the image I want to use to the content (lets just call it Pic), have labeled Texture2D, and have tried to implement the image into my program with the following code:

[source lang="csharp"]myTexture = Content.Load<Texture2D> ("Pic");[/source]

I have also tried this.Content.Load<>

In either case, when I compile the program it tells me that file "Pic" cannot be found. Not sure what I'm missing. I've followed a couple tutorials to a T and no matter which way I've done it, or that I've tried adding different picture files to Content, it cannot "find" the image.

Any help is appreciated.

EDIT: I wiped the file I was working with and tried with a fresh file, only inserting the applicable code. It worked...idk why it couldn't find my file before

#2Kuam

Posted 16 June 2012 - 02:32 PM

I'm having trouble drawing images in my program. It is not a variable problem or syntax problem so I'm a little lost.

To clarify, this is in XNA.

I've added the image I want to use to the content (lets just call it Pic), have labeled Texture2D, and have tried to implement the image into my program with the following code:

[source lang="csharp"]myTexture = Content.Load<Texture2D> ("Pic");[/source]

I have also tried this.Content.Load<>

In either case, when I compile the program it tells me that file "Pic" cannot be found. Not sure what I'm missing. I've followed a couple tutorials to a T and no matter which way I've done it, or that I've tried adding different picture files to Content, it cannot "find" the image.

Any help is appreciated.

EDIT: My code is not putting the <Texture2D> after the Content.Load - I have it in there in my program

#1Kuam

Posted 16 June 2012 - 02:31 PM

I'm having trouble drawing images in my program. It is not a variable problem or syntax problem so I'm a little lost.

To clarify, this is in XNA.

I've added the image I want to use to the content (lets just call it Pic), have labeled Texture2D, and have tried to implement the image into my program with the following code:

[source lang="csharp"]myTexture = Content.Load<Texture2D> ("Pic");[/source]

I have also tried this.Content.Load<>

In either case, when I compile the program it tells me that file "Pic" cannot be found. Not sure what I'm missing. I've followed a couple tutorials to a T and no matter which way I've done it, or that I've tried adding different picture files to Content, it cannot "find" the image.

Any help is appreciated.

PARTNERS