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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T04:30:39+00:00 2026-05-30T04:30:39+00:00

I am creating an object server-side which is to have all of the data

  • 0

I am creating an object server-side which is to have all of the data necessary to represent the object client-side. One of the properties I would like my client-object to have is the its icon.

Currently, I have the following code. It hasn’t been ran yet, I just wanted to discuss some things with S.O:

public class ComponentDiagramPolygonChild
{
    IconServicesSoapClient IconServicesProxy = new IconServicesSoapClient("IconServicesSoap");

    public string Name { get; set; }
    public byte[] Icon { get; set; }

    public ComponentDiagramPolygonChild(PlanViewComponent planViewComponent)
    {
        Name = planViewComponent.Name;
        //TODO: Can icon ever return null here?
        Icon = IconServicesProxy.GetIconByID(planViewComponent.Icon).Image;
        planViewComponent.
    }
}

It seems to me that I have two options available:

  • Store the ID of the Icon as the property instead of byte[].
  • Store the Icon as a byte[].

If I use the former suggestion I will need to go out to the server and request the image data by passing to the server the icon’s ID. I believe this would be a more simplistic approach — I would just return a memory stream housing the image and load that stream in the desired location. The negative aspect of this is multiple hits on the server which seem to be completely unnecessary.

If I use the latter suggestion I will be passing a (significantly?) larger amount of data across the network. I am unsure if byte arrays are able to be JSONized properly. I am unsure of how to take a jsonized byte[] and convert it into image data.

Does anyone have any experience with this situation? How should I tackle this? Thanks.

EDIT: After doing some reading it looks like the former option is my best bet.

  • 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-30T04:30:41+00:00Added an answer on May 30, 2026 at 4:30 am

    I think from a technical and programming point of view, it would be cool to pass the data image back.

    You could do that with a base64 encoded version of the image, and most modern browsers will support that. You could also do it with the HTML5 canvas object. Documentation is available on the MDN.

    However, from a practical point of view, the most maintainable solution is to use an ID and let it make a separate HTTP request. No HTML 5 required, supported in pretty much every browser in use, and you can reuse existing image delivery systems.

    If your server is tuned, it will be OK to have that extra HTTP request for the image, and it will be much less CPU load on the server if you are doing a lot of these images.

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

Sidebar

Related Questions

I have client-server application, where server side is Azure WCF service with data in
I have a slight problem with creating a button on the server side code.
I am creating an object at server side of an aspx (test.cs) page from
I am creating node.js app using express, everyauth and now.js. I have a server-side
In my server side code I'm creating the following response object: var response =
I have astring directly coming form the database and I am creating object of
I am creating an object which tracks changes (Updates) regarding the creation, updating and
I have a couple questions about creating a object (2 values) and how to
I need to call ASP.Net server side code from the client. Because I'm in
I have Java code which queries calendar entries from a Lotus Notes Domino server

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.