I have Web service for making BarcodeImage. It return Image in form of property of class ReturnData like,
public class ReturnData
{
public Image BarcodeImage {get;set;}
public bool IsError {get; set;}
public string ErrorDesc { get;set;}
}
Now I add service reference into my website. The all things are worked but when I assign return Image value than it gives error for invalid conversion
like
System.Drawing.Image retImage = ReturnData.BarcodeImage;
(Here ReturnData is object of WebService ReturnData class. I am not writing all stuff)
Please how i get this image from Web service
I think you need to convert the image into a byte array first before sending it to the. On the receiving side, conversion from byte array to image.
One more way is to convert the image into a base 64 string when sending and then from base64 to image when receiving.
Below code is from here:
Image to Base64 String
Base64 String to Image