How to create Raw Image Data

A

Ananas

Hi,

I need to open an image and pass it to another unit as a Raw Image Data
(etc. it is an array of bytes with length equals
ImageWidth*ImagehHeigth*3 for 24bit per pixel format, image looks
RGBRGBRGB...RGB).

How to make it fast?

Thanks in advise,
Eugene.
 
?

=?ISO-8859-2?Q?Marcin_Grz=EAbski?=

Hi,

1. Read an image as Bitmap.
2. Call the Bitmap.LockBits(...) method.
3. Check the Bitmap.PixelFormat
4. Read the Bitmap.Scan0 unsafe or safe by MarshalCopy(...)

Read the .NET docs or MSDN for more details.

HTH
Marcin

Ananas napisa³(a):
 
A

Ananas

3. Check the Bitmap.PixelFormat

What for to check this?
Read the .NET docs or MSDN for more details.

I did read it, but some things get with experience.

Thank you sir.
 
A

Ananas

Thank you for your answer.

I could get the raw image data. I tried to open 48 bit RGB image and
transform it to 24 bit RGB image by using LockBits with Format24bppRgb.
And it works!

Best regards,
Eugene.
 

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

Top