1

I'd like to easy change image files in my program and have access to their names and amount of them. What method do you suggest? Should i read images as array from folder or better make resource file with them?

Piotr Łużecki
  • 1,031
  • 4
  • 17
  • 33
  • 1
    Windows Forms? ASP.NET? WPF?... – Wonko the Sane Mar 27 '12 at 17:48
  • WPF is the newest technology but unless you want to learn the markup language that comes with it (XAML), which a lot of people, including myself don't (I have other things to do. I'll probably eventually get around to doing it), definitely WinForms. – Ashley Davies Mar 27 '12 at 17:51
  • I want to make map editor for my (undone) game, as easy as it could be. So i tought that C# is good idea. – Piotr Łużecki Mar 27 '12 at 17:54

1 Answers1

2

If you are making a map editor, then I imagine you will have lots of small images to handle in which case it may be a good idea to store them in some form of resource file, although you may have more flexibility to change them if you store them externally in a folder.

Once the images are loaded in, I would imagine you will want to store them in some form of hierarchical structure if its for a map editor too, associated to the object of which they represent.

If you plan to do any processing on large images, investigate using Bitmap.LockBits() as this will be much more efficient. http://msdn.microsoft.com/en-us/library/5ey6h79d.aspx

Using resources: Load image from resources area of project in C#

Loading images from file: http://msdn.microsoft.com/en-us/library/4sahykhd.aspx

Community
  • 1
  • 1
TomP89
  • 1,420
  • 3
  • 11
  • 29