Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6859491
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T02:17:24+00:00 2026-05-27T02:17:24+00:00

I have Web service for making BarcodeImage. It return Image in form of property

  • 0

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

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T02:17:25+00:00Added an answer on May 27, 2026 at 2:17 am

    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

    public string ImageToBase64(Image image, 
      System.Drawing.Imaging.ImageFormat format)
    {
      using (MemoryStream ms = new MemoryStream())
      {
        // Convert Image to byte[]
        image.Save(ms, format);
        byte[] imageBytes = ms.ToArray();
    
        // Convert byte[] to Base64 String
        string base64String = Convert.ToBase64String(imageBytes);
        return base64String;
      }
    }
    

    Base64 String to Image

    public Image Base64ToImage(string base64String)
    {
      // Convert Base64 String to byte[]
      byte[] imageBytes = Convert.FromBase64String(base64String);
      MemoryStream ms = new MemoryStream(imageBytes, 0, 
        imageBytes.Length);
    
      // Convert byte[] to Image
      ms.Write(imageBytes, 0, imageBytes.Length);
      Image image = Image.FromStream(ms, true);
      return image;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an ASP.NET (.asmx) Web Service project that has a method like: public
I have a Java web service and a Java web client making use of
I am Making an Iphone application which is web-service enabled. Also I have skeleton
I have set up a CXF web service which works well. My service primarily
I have an axis web service running in Tomcat. Clients are making connections without
We have a RESTful web service with a URI pattern like: /orders/ /orders/1 /orders/1/changelog
I am making Map application and I have already able to call web service
I am making request to web service and have to do this extending AsyncTask
I have an application that is making SOAP web service calls to another application
I have 2 different XMLHttpRequest objects making asynchronous requests to the same web service.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.