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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T21:09:36+00:00 2026-06-17T21:09:36+00:00

I have a problem with displaying an image it’s bytes comes to my pc

  • 0

I have a problem with displaying an image it’s bytes comes to my pc serial port as chunks of data, 32 bytes at a time, how to keep all the incoming bytes in the same memory stream, then how can I display this image in a picture box

Here is a piece of code

if (((int)header[0] == 0x76) && (header[1] == 0x00) && (header[2] == 0x32) && (header[3] == 0x00) && (header[4] == 0x00)) /// the header is true ,read the image bytes
{
    for (int i = 0; i < 32; i++)
        Jpg[i] = (byte)CamPort.ReadByte();

    fs.Write(Jpg, 0, Jpg.Length);

    for (int i = 1; i < Jpg.Length; i++)
    {
        if ((Jpg[i - 1] == 0xFF) && (Jpg[i - 0] == 0xD9))// reaching the last two bytes(FF D9) of Jpg //
        {
            EndFlag = true;
            MessageBox.Show("done");
            //OneSnap.Image = Image.FromStream(fs);
            fs.Close();
        }
    }
}
else
{
    MessageBox.Show("DONE");
}
  • 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-06-17T21:09:37+00:00Added an answer on June 17, 2026 at 9:09 pm

    I would just use a nested loop and add 32 bytes at a time to a larger array.

    int offset = 0;
    for(int i = 0; i < total; i++){
        for(int j = 0; j < 32; j++){
            offset = i * 32;
            jpg[offset + j] = (byte)CamPort.ReadByte();
        }
     }
    

    Something like that should get all your data into one array, then you can do manipulation with/on that data. From there it should be a relatively straight-forward matter to display the data in whichever fashion you’d like.

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

Sidebar

Related Questions

Introduction: I have an AdvancedDataGrid displaying hierarchical data illustrated by the image below: The
I have problem with displaying bitmap image on imageview on high density screen (480x800).
I have a problem with displaying a background image on the iPhone 5. I
I have a problem with a few div boxes displaying an overflowing/repeating image only
I have problem regarding displaying image in datagrid column. When Datagrid loads it shows
I have problem with displaying adsense ads in ie7 google adsense adds an iframe
I have a problem displaying non- ASCII characters in Matplotlib, these characters are rendered
I have a problem displaying zebra list after filtering results. I have a zebra
I'm generating dynamic HTML inside Delphi. I have no problem displaying UTF-8 strings inside
I have some problem with displaying emoji icon in Android TextView First, I found

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.