-1

I am writing a simple game. I want to use object array to store id of object and an image from resources. How do I do that?

I tried to use _Properties.Resources_ in array, but it does not work. Is there any way to do this?

This is my array:

public object[,] CharacterImages =
    {
        //{id, resource_name}
        {0, 0},
        {1, "flower.bmp"}
    };
Ivaylo Slavov
  • 8,839
  • 12
  • 65
  • 108
Jan Bońkowski
  • 538
  • 9
  • 22
  • 3
    See [Load image from resources area of project](http://stackoverflow.com/questions/1192054/load-image-from-resources-area-of-project-in-c-sharp) – huMpty duMpty Feb 20 '14 at 11:06

1 Answers1

1

Try this

Public object[,] CharacterImages =
{       
    {0, global::ProjectName.Properties.Resources.flower.bmp;}
};
Vignesh Kumar A
  • 27,863
  • 13
  • 63
  • 115