472,097 Members | 1,058 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

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

Converting 8bpp raw data to a 32bppArgb Bitmap

I have a buffer of byte[] that contains a raw data of a 1 byte-per-pixel
image data.
I need to convert this buffer to a Bitmap of Format32bppArgb and to a Bitmap
of Format24bppRgb.

Can anybody tell how to do it?
------
Thanks
Sharon
Feb 27 '06 #1
3 5830
Hi Sharon,

Based on my knowledge, we can use some existed librarys to achieve this
goal, for example Free Image library. I hope the following information will
be helpful for you:
Title: C# Wrapper to the FreeImage DLL for graphical image format conversion
URL:http://www.codeproject.com/csharp/Fr...eCSWrapper.asp

Thanks for your understanding!

Best Regards,

Terry Fei [MSFT]
Microsoft Community Support
Get Secure! www.microsoft.com/security

--------------------
Thread-Topic: Converting 8bpp raw data to a 32bppArgb Bitmap
thread-index: AcY7fEKl6dH+VRzqSJCc3IvuqXa8QA==
X-WBNR-Posting-Host: 199.203.93.141
From: =?Utf-8?B?U2hhcm9u?= <Sh*****@newsgroups.nospam>
Subject: Converting 8bpp raw data to a 32bppArgb Bitmap
Date: Mon, 27 Feb 2006 01:00:30 -0800
Lines: 11
Message-ID: <61**********************************@microsoft.co m>
MIME-Version: 1.0
Content-Type: text/plain;
charset="Utf-8"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
Content-Class: urn:content-classes:message
Importance: normal
Priority: normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
Newsgroups: microsoft.public.dotnet.languages.csharp
NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
Xref: TK2MSFTNGXA01.phx.gbl microsoft.public.dotnet.languages.csharp:388592
X-Tomcat-NG: microsoft.public.dotnet.languages.csharp

I have a buffer of byte[] that contains a raw data of a 1 byte-per-pixel
image data.
I need to convert this buffer to a Bitmap of Format32bppArgb and to a Bitmapof Format24bppRgb.

Can anybody tell how to do it?
------
Thanks
Sharon


Feb 28 '06 #2
I know the FreeImage and I'm using it. But it's not good for me in this case.
But I did found a simple way to do that:
(1) Create a Bitmap with the same size of the source image (buffer) but with
Format32bppArgb pixel format.
(2) Use the created bitmap graphics and draw the source image (8bpp pixel
format) onto the newly created bitmap.

Note: The raw data buffer that contains the 8bpp image data can be taken
from a Bitmap with Format8bppIndexed pixel format, then it can be written
with the relevant data, and by using my above procedure, it can be converted
to Format32bppArgb bitmap.

that is it.
-------
Thanks
Sharon
Feb 28 '06 #3
Hi Sharon,
Thanks for your update! :)

We really appreciate your taking the time to provide us with feedback on
how you were successful in resolving this issue. I think this invaluable
experience can benefit others in the newsgroup facing this issue. Thanks
for your knowledge sharing!

Best Regards,

Terry Fei [MSFT]
Microsoft Community Support
Get Secure! www.microsoft.com/security

--------------------
Thread-Topic: Converting 8bpp raw data to a 32bppArgb Bitmap
thread-index: AcY8PS1ArfHdre8oS4COkBfiDyMlEA==
X-WBNR-Posting-Host: 199.203.93.141
From: =?Utf-8?B?U2hhcm9u?= <Sh*****@newsgroups.nospam>
References: <61**********************************@microsoft.co m> <Om**************@TK2MSFTNGXA03.phx.gbl>Subject: RE: Converting 8bpp raw data to a 32bppArgb Bitmap
Date: Tue, 28 Feb 2006 00:01:27 -0800
Lines: 18
Message-ID: <1C**********************************@microsoft.co m>
MIME-Version: 1.0
Content-Type: text/plain;
charset="Utf-8"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
Content-Class: urn:content-classes:message
Importance: normal
Priority: normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
Newsgroups: microsoft.public.dotnet.languages.csharp
Path: TK2MSFTNGXA03.phx.gbl
Xref: TK2MSFTNGXA03.phx.gbl microsoft.public.dotnet.languages.csharp:388830
NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
X-Tomcat-NG: microsoft.public.dotnet.languages.csharp

I know the FreeImage and I'm using it. But it's not good for me in this case.But I did found a simple way to do that:
(1) Create a Bitmap with the same size of the source image (buffer) but withFormat32bppArgb pixel format.
(2) Use the created bitmap graphics and draw the source image (8bpp pixel
format) onto the newly created bitmap.

Note: The raw data buffer that contains the 8bpp image data can be taken
from a Bitmap with Format8bppIndexed pixel format, then it can be written
with the relevant data, and by using my above procedure, it can be convertedto Format32bppArgb bitmap.

that is it.
-------
Thanks
Sharon


Mar 1 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by James Dean | last post: by
reply views Thread by Mark Allen | last post: by
2 posts views Thread by Map Reader | last post: by
2 posts views Thread by heathimself | last post: by
2 posts views Thread by Laurent Navarro | last post: by
reply views Thread by Oriane | last post: by
reply views Thread by leo001 | last post: by

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.