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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T21:57:39+00:00 2026-05-23T21:57:39+00:00

I want to build a Screen Sharing program in C#.(with TCP) I sniffed around

  • 0



I want to build a Screen Sharing program in C#.(with TCP)

I sniffed around the web and found out that the most efficient way to do it is by sending alot of screenshots from the client to the server.

The point is – how can I compress a Bitmap to Jpeg – receive it on the server and decompress again to Bitmap (so I can show it in a form) ?

I’ve tried using the JpegBitmapEncoder with no luck, here’s my code:

        Bitmap screen = TakeScreenshot();
        MemoryStream ms = new MemoryStream();
        byte[] Bytes = BmpToBytes_Unsafe(screen);
        ms.Write(Bytes, 0, Bytes.Length);
        Jpeg = new JpegBitmapEncoder();
        Jpeg.Frames.Add(BitmapFrame.Create(ms));
        Jpeg.QualityLevel = 40;
        Jpeg.Save(ms);
        BinaryReader br = new BinaryReader(ms);
        SendMessage(br.ReadBytes((int)ms.Length));

It throws an NotSupportedException at Jpeg.Frames.Add(BitmapFrame.Create(ms));

No imaging component suitable to complete this operation was found.

So I need a way to convert a Bitmap to Jpeg, then to byte[], then send it over TCP.

And on the other end, do the exact opposite. Any suggestions ?

Thank you.

  • 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-23T21:57:40+00:00Added an answer on May 23, 2026 at 9:57 pm

    JPEG was designed for photographs, not for screen captures. Also, most of the screen doesn’t change so better to just send the changed portions and only a full screen when much of the screen has changed.

    Unless you’re just doing this for fun, you are going about this all wrong. VNC has been doing this for years and the source code is free so you could look to see how that’s done.

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

Sidebar

Related Questions

I want to build a program that prints the current screen (every few seconds)
I want to build a python program that get as input a path to
I want build a financial analysis tool that will feature screen after screen of
I want to build a navigation screen, just like installation shields has (next/previous stuff),
I want build a sketch pad app on iPhone, I assume that this type
I want to build a website that uses Flex/Flash as the GUI, and Java
I want to build a bot that basically does the following: Listens to the
I am trying to build a website with a background image that I want
I am having a browser-oriented web app build on Rails (3.1). I want to
I want to build an iPad app that detect an alphabet physical shape placed

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.