ImageData property returns error

Posted by: perry on 12 February 2018, 7:58 pm EST

    • Post Options:
    • Link

    Posted 12 February 2018, 7:58 pm EST

    I have a png image in a byte array variable called sigFileImage.

    Me.ImageBox.ImageData = New IO.MemoryStream(sigFileImage)

    When I assign the stream of this byte array to the image control I get an error:

    Unknown type of image:137

    But it is not unknown because I can use this same stream elsewhere and the PNG shows fine.

  • Posted 13 February 2018, 2:47 am EST

    Hello,

    Could you share the exact version of ar that you are using? Because at my end,

    ImageData is “String” type property. Hence, it gives compile time error “Value of type ‘MemoryStream’ cannot be converted to ‘String’”. Also, it is very helpful for us, if you could share the project with us, so that we can replicate at our end.

    Thanks,

    Mohit

  • Posted 13 February 2018, 4:30 am EST

    Using ActiveReports v12. As you can see from the included screenshot, when I hover over the ImageData property it shows its type as IO.Stream which is just what I need.

    I included the report too although it won’t work by itself since it has many other dependencies in a very large project. But at least you can see that ImageData is indeed a stream.

  • Posted 13 February 2018, 5:38 am EST

    Hello,

    It seems that files are not attached properly. Could you please attached the file again. Also, please note that you can only upload the PNG or zip format file.

    Thanks,

    Mohit

  • Posted 13 February 2018, 12:59 pm EST

    Here are the files again.

  • Posted 14 February 2018, 2:27 am EST

    Hello,

    Unfortunately, I have not seen any attached files. Maybe there is a problem in attaching the files. You can upload your files at the following link:

    https://www.dropbox.com/request/pprgRUGcO6evALDBlZUj

    Thanks,

    Mohit

  • Posted 14 February 2018, 1:13 pm EST

    OK I uploaded them to dropbox.

  • Posted 16 February 2018, 5:12 am EST

    Hello,

    Sorry for delay response as I am on leave.

    Please use the following code to load the image in report:-

    
    	Dim data As Byte() = CType(objReader("SigFileImage"), Byte())
            Dim stream As MemoryStream = New MemoryStream(data)
            Me.Signature.Image = Image.FromStream(stream)
    
    

    Hope it helps.

    Thanks,

    Mohit

  • Posted 20 February 2018, 5:06 am EST

    Yes that worked, Thanks

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels