How do I render JPEG Data stored in char* buffer?

O

On the Sparrow

I have a 3rd party API that store compressed JPEG data in a char
buffer.ll

How do I convert it to either an System::Drawing or somekind of format
that I can display in a Windows::Form?
 
?

=?ISO-8859-1?Q?Andreas_Thors=E9n?=

I have a 3rd party API that store compressed JPEG data in a char
buffer.ll

How do I convert it to either an System::Drawing or somekind of format
that I can display in a Windows::Form?

It sounds like your using some managed language. Here's sample code for C#:

// Assuming char buffer contains jpeg header
MemoryStream memStream = new MemoryStream(jpeg_buffer, 0, buffer_size);
Bitmap bitmap = new Bitmap(memStream);
myPictureControl.BackgroundImage = bitmap;

--Andreas
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top