[RESOLVED] Image Wrapper or Image Property Array
Hello.
I am trying to make an Image wrapper class or something. The reason for this is that I need to output a bunch of images only, without pictureboxes. I don't want an imagelist, because I need the images along with their associated image properties which an imagelist cannot provide. I ended up with this :
Class 1 (images ) :
Code:
Public PB(intAmountImages) As PictureBox
Public Sub New(ByVal pbn() As PictureBox)
For index = 0 To pbn.Length - 1
Me.PB = pbn
Next
End Sub
'expose properties you DO want to show
Public Property Images(ByVal index As Integer) As Image
Get
Return PB(index).Image
End Get
Set(ByVal value As Image)
PB(index).Image = value
End Set
End Property
Windows Form Class :
Code:
Private arrOutPutImages As comPicturePirate
Private Sub LoadFiles()
arrOutPutImages = New comPicturePirate
arrOutPutImages.AmountImages = intNumPics - 1
For i As Integer = 0 To arrOutPutImages.AmountImages
arrOutPutImages.Images(i) = New Bitmap(imlPPImages.Images(i)) Next
the whole problem is that when it gets to the bolded line it throws me an error stating that i should use new.
Any help? Am i on the right track?
thanks
Re: Image Wrapper or Image Property Array
Wouldn't
Code:
Dim lst As New List(Of Image)
satisfy your needs?
Anyway, provide an EXACT and FULL error message you're getting.
Re: Image Wrapper or Image Property Array
I managed to come right with your suggestion.
Thank you