Hi I have a need to deserialize an XML file which contains an image in base64 string. When I deserialize the XML the image is straight away populated as bytes by the following class. Which pretty much eliminates the need to do anything fancy and I write the image from those bytes. However a few images print as corrupt while others are perfectly fine. I need to resolve why few images are corrupt. Either the source is incorrect or I am missing something.
My question is 'is it necessary to use Convert.FromBase64String() function to convert the base64 string to bytes?' Doing this doesn't really make a difference anyway.
I suppose that the XML deserialization process automatically does that job
Can anybody please provide a credible source for whatever the case maybe?
Public Class Graphics_Data
Private _Image_Graphic As List(Of Byte())
<XmlElement("Image_Graphic")>
Public Property Image_Graphic As List(Of Byte())
Get
Return _Image_Graphic
End Get
Set(value As List(Of Byte()))
_Image_Graphic = value
End Set
End Property
End Class