473,395 Members | 1,574 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

C# Windows application (GUI) Displaying a JPEG

2
Hi Guys

I am a newbie to C#. I have a camera that sends me jpeg data in 500byte packets via the serial port. The encoding and compression is already done on the camera. The data is pure compressed jpeg. I simply want to receive this data via serial port and display the picture in a picture box. Receiving the data is not the problem as I understand the serial port class. Its how to display the data that I have no clue about. I would appreciate the simplest manner posssible plz

Thank you
Mar 19 '08 #1
3 2346
Plater
7,872 Expert 4TB
I think what you would need is to use the Bitmap object (yes I know it seems like it is for BMP but it handles all image types)
You can create a Bitmap object from a byte stream (use MemoryStream on your completed collection of bytes from the serial port) and then you should be able to set that object to a PictureBox control or some other control.
Mar 19 '08 #2
anwarv
2
I was thinkink about using filestream. However I was not sure If this can be used for jpg files as all the examples I have seen involve txt files
Mar 19 '08 #3
Plater
7,872 Expert 4TB
Well if the picture data you are getting is a complete jpeg data (header and all that good stuff), then a filestream would be fine. You could write the data bytes to the filestream (create a temp.jpg?) and then show it in your form.

I wasn't sure if you wanted to go the temp file route.


Actually, I suppose you could write a lot of jpeg files and just append the date/time to the filenames and create as many as you wanted.
Mar 19 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: corrado | last post by:
Hello I have an application running several thread to display some financial data; basically I have a thread displaying HTML tables by means of Tkhtml, another implementing a scrolling ticker...
1
by: Doran_Dermot | last post by:
Hi All, I'm currently using "os.listdir" to obtain the contents of some slow Windows shares. I think I've seen another way of doing this using the win32 library but I can't find the example...
8
by: nickdu | last post by:
I'm trying to isolate "applications" into their own application domain within a single process. I've quoted applications because it's a logical representation of an application. Basically it...
0
by: Tim Haughton | last post by:
I've just released an article on using Test Driven Development with C# and Windows Forms. GUI's are often difficult to test, so I thought it might be of interest. The article along with the...
14
by: Brian Keating EI9FXB | last post by:
I wonder can anyone reccomment a solution to this problem. Let me explain, I've services running on my system, my application receives diagnostic messages from these services, what i want to do...
9
by: Rajat Tandon | last post by:
Hello there, I am relatively new to the newsgroups and C#. I have never been disappointed with the groups and always got the prompt replies to my queries.This is yet another strange issue, I am...
113
by: dan | last post by:
For writing a Windows desktop application, how much harder is it to use the Windows C API than C#/.NET, assuming the coding is done in an editor? What specific aspects were more difficult? I'm...
3
by: illegal.prime | last post by:
Hi all, I have a service that needs to start a regular windows application. I'm running the service as ServiceAccount.LocalSystem. But, when it starts the process (using Process.Start) the GUI...
9
by: Mohitz | last post by:
Hi, How do you write a Windows GUI application in C++ ?? And is C++ the best language to write GUI applications in? Thank you Mohit
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.