Results 1 to 3 of 3

Thread: [RESOLVED] Image Wrapper or Image Property Array

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Sep 2005
    Posts
    384

    Resolved [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

  2. #2
    PowerPoster cicatrix's Avatar
    Join Date
    Dec 2009
    Location
    Moscow, Russia
    Posts
    3,654

    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.

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Sep 2005
    Posts
    384

    Re: Image Wrapper or Image Property Array

    I managed to come right with your suggestion.

    Thank you

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width