Results 1 to 3 of 3

Thread: ArrayList image to imagelist

  1. #1

    Thread Starter
    New Member
    Join Date
    Oct 2004
    Location
    Lost in space
    Posts
    9

    Question ArrayList image to imagelist

    Hi Guys,

    As a relative newbie to .Net, can anyone give me some advice please?

    I have interfaced to a scanner using the twain dll. Once scanning is complete it outputs an arraylist (e.g twain.transferPictures()) of the images.

    I need to get these images into an ImageList, but when I try to I get an error telling me it is an invalid type cast.

    The code is:
    Code:
    private sub populateIList
                       Dim pics As ArrayList = tw.TransferPictures()
                        Dim i As Integer
                        Dim img As ImageList
    For i = 0 To pics.Count - 1 Step 1
                             = CType(pics, ImageList
    end sub

  2. #2

    Thread Starter
    New Member
    Join Date
    Oct 2004
    Location
    Lost in space
    Posts
    9
    oops, sorry had not finished and posted by mistake! Message should have been;

    Hi Guys,

    As a relative newbie to .Net, can anyone give me some advice please?

    I have interfaced to a scanner using the twain dll. Once scanning is complete it outputs an arraylist (e.g twain.transferPictures()) of the images.

    I need to get these images into an ImageList, but when I try to I get an error telling me it is an invalid type cast.

    The code is:

    Code:
    private sub populateIList
                        Dim pics As ArrayList = tw.TransferPictures()
                        Dim i As Integer
                        Dim img As ImageList
                        For i = 0 To pics.Count - 1 Step 1
                             img.images.add(pics(i))
                        next   
    end sub
    Please help me spot the obvious? error of my ways!

    Regards
    Terry.

  3. #3

    Thread Starter
    New Member
    Join Date
    Oct 2004
    Location
    Lost in space
    Posts
    9

    Resolved

    OK, I've seen the error of my ways. The transferPictures method wasn't exactly what I thought it was.
    Thanks.

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