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 1096383
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T00:16:37+00:00 2026-05-17T00:16:37+00:00

I have a class containing: [Serializable] public class ClsStatus { public byte[] Image {

  • 0

I have a class containing:

[Serializable]
public class ClsStatus
{
     public byte[] Image { get; set; }
     public string Status { get; set; }
     public List<string> Servers { get; set; }
}

Now i am doing:

System.Drawing.Image image = null;
            byte[] imageBytes = null;

        // Create an image of the chart.
        using (MemoryStream s = new MemoryStream())
        {
            chart.ExportToImage(s, System.Drawing.Imaging.ImageFormat.Jpeg);
            image = System.Drawing.Image.FromStream(s);
            imageBytes = s.ToArray();
        }
        ClsStatus status = new ClsStatus();
        List<string> servers = new List<string>();
        servers.Add("Server1");
        servers.Add("Server2");
        servers.Add("Server2");

        status.Image = imageBytes;
        status.Status = "Up & Running";
        status.Servers = servers;

        //XML Serialization
        XmlDocument doc = new XmlDocument();
        XmlSerializer serializer = new XmlSerializer(status.GetType());
        MemoryStream stream = new MemoryStream();
        try
        {
            serializer.Serialize(stream, status);
            stream.Position = 0;
            doc.Load(stream);
            Response.ContentType = "text/xml";
            Response.Clear();
            Response.Write(doc.InnerXml);
        }
        catch
        {
            throw;
        }

My Desired out put and what i am getting fro the above code is here:
https://i.stack.imgur.com/YgKgH.jpg

Is there any one who can help me in solving my issue?

Regards,
Mohin

  • 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-17T00:16:38+00:00Added an answer on May 17, 2026 at 12:16 am

    XML is pretty much a text-based format, which means you’re not going to be able to “see the image” in your XML document.

    The closest you can get is to encode the binary image data into a “text” string (typically through Base64 encoding) and then embed the string into the XML document. That’s exactly what you’re getting now.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Setting.cs file containing the info [Serializable] public class Setting { public
I have a class containing two properties: public class player{ public player(String playerName,int points){
I have an example class containing two data points: public enum Sort { First,
I have a list of items, where each item is a simple class containing
I have a class containing a static create method. public class TestClass { public
I have a class containing a SortedList<string, Data> as private field, where Data is
I have a class containing a number of properties, something like: public class Update
I have Class called Person containing to properties, Father and List of Children. I
I currently have a class containing the following properties public class Chromosome { public
I have a class MyClass containing a private List<MySecondClass> myList . The list is

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.