Get an array of images from a resx file C# -


I am having trouble getting images from my properties. In an array of resources Each image has its own name, but I can not find any way to manually put it into an array manually without typing them.

  System.Drawing.Bitmap [] imageArray = New system. Drawing. Bitmap [29]; ImageArray [0] = Properties. Resources.Corno; ImageArray [1] = Properties. Resources. BatteryNan; ImageArray [2] = Properties. Resources. Battermann Micro;  

etc.

Is there any easy way to create an array from my resource.rex file without changing the names of files?

You can use ResourceSet to generate an array:

 < Code> var resourcesset = properties Resources. resource Manager. GetResourceSet (System. Globalization. Cultural Information. Current Ukuret, True, True); System.Drawing.Bitmap [] imageArray = resourceSet.OfType & lt; System.Collections.DictionaryEntry & gt; (). Select (i => (System.Drawing. Bitmap) i.Value) .toArray ();  

Comments

Popular posts from this blog

HTML/CSS - Automatically set height width from background image? -

php - Mysql Show Process - Sleep Commands and what to do -

c - What is the address of buf (the local variable in the main function)? -