PC Review


Reply
Thread Tools Rate Thread

How to create Raw Image Data

 
 
Ananas
Guest
Posts: n/a
 
      18th Jan 2007
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.

 
Reply With Quote
 
 
 
 
=?ISO-8859-2?Q?Marcin_Grz=EAbski?=
Guest
Posts: n/a
 
      18th Jan 2007
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):
> 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.
>

 
Reply With Quote
 
Ananas
Guest
Posts: n/a
 
      18th Jan 2007
> 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.

 
Reply With Quote
 
=?ISO-8859-2?Q?Marcin_Grz=EAbski?=
Guest
Posts: n/a
 
      18th Jan 2007
Hi,

Ananas napisał(a):
>> 3. Check the Bitmap.PixelFormat

>
> What for to check this?


To make sure if you're working with 24bit bitmaps.

>> Read the .NET docs or MSDN for more details.

>
> I did read it, but some things get with experience.
>
> Thank you sir.


Cheers!
Marcin
 
Reply With Quote
 
Ananas
Guest
Posts: n/a
 
      19th Jan 2007
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.

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Create jpg from byte array of raw image data =?Utf-8?B?Q3ludGhpYQ==?= Microsoft Dot NET Framework 1 22nd Feb 2006 05:37 AM
Create image thumbnail without opening complete image =?Utf-8?B?TWFyayBSLiBEYXdzb24=?= Microsoft C# .NET 2 18th Oct 2005 04:14 PM
Read Bitmap and create Method to Create Image at runtime Mark Johnson Microsoft Dot NET Framework 1 28th Nov 2003 08:26 PM
How to create smaller image from a bigger image - please help ! Anand Ganesh Microsoft C# .NET 0 14th Jul 2003 05:14 PM
Please help. How to create a small image from a big image - Any Suggestions Please ? Anand Ganesh Microsoft C# .NET 0 14th Jul 2003 05:54 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:35 AM.