Hello everyone
I have included 6 png files to my.Resources project and I am trying to load them into an image array at runtime.
But without effect, I am getting Error String cannot be converted to System.Drawing Image
Dim Pics(6) As Image
Dim str As String
For i = 0 To Pics.Length - 1
str = "my.Resources.Pic" & i + 1
[highlight #EF2929]Pics(i) = str[/highlight]
Next
I understand that I cannot assing a string value to an image type array. But I have to do it someway and I dodn't know the way to assign the value. The names resources' pictrures are Pic1, Pic2, Pic3, Pic4, Pic5, Pic6 and I wouldn't like to do it without a loop statement. Althoug everytime the value of each array element is different Pic1, Pic2 etc... (it's just different from the last character) what about if I had 50 images? I am a little bit confused. Please any help will be much appreciated.
Thanks everybody
in advanced.
I have included 6 png files to my.Resources project and I am trying to load them into an image array at runtime.
But without effect, I am getting Error String cannot be converted to System.Drawing Image
Dim Pics(6) As Image
Dim str As String
For i = 0 To Pics.Length - 1
str = "my.Resources.Pic" & i + 1
[highlight #EF2929]Pics(i) = str[/highlight]
Next
I understand that I cannot assing a string value to an image type array. But I have to do it someway and I dodn't know the way to assign the value. The names resources' pictrures are Pic1, Pic2, Pic3, Pic4, Pic5, Pic6 and I wouldn't like to do it without a loop statement. Althoug everytime the value of each array element is different Pic1, Pic2 etc... (it's just different from the last character) what about if I had 50 images? I am a little bit confused. Please any help will be much appreciated.
Thanks everybody
in advanced.