Thanks. I'll try your suggestion.
"John Hornick [MSFT]" <JHornick@online.microsoft.com> wrote in message
news:B08kUfV0DHA.2628@cpmsftngxa07.phx.gbl...
> Hi,
>
> Try storing the bytes into a file - then you can inspect the file
> and ensure it contains reasonable image bits for whatever format
> image file you've saved.
>
> Keep in mind that this constructor assumes the bytes are in the same
> format as the contents of an image file. So if you have just image
> bits in DIB format, you'll need to use a different constructor then
> copy the image bits to Scan0.
>
> Thanks,
> - John
> Microsoft Developer Support
> This posting is provided "AS IS" with no warranties, and confers no
rights.
> Visit
http://www.microsoft.com/security for current information on
security.
>
>
>
>
> > I am trying to create an image from an array of bytes stored in a
> > base64binary dataset field and I keep getting the same error: System
> > argument exception. Invalid parameter used.
> > The field definitely contains an image because it is obtained from an
> image
> > file and placed into the database.
> > The error occurs on the third line. The overloaded constructor of the
> bitmap
> > class can accept a stream object and "m" is a memorystream object that
> > inherits from stream, so I don't see why it would not work.
> > Any suggestions?
> >
> > Here's one of the attempts I made (VB.Net):
> >
> > Dim b() As Byte = Me.dtDataSet.t_mytable(0).mypicture
> > Dim m As New System.IO.MemoryStream(b)
> > Dim Img As New Bitmap(m)
>