473,386 Members | 1,699 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,386 software developers and data experts.

converting a byte array to a 1bpp bitmap

Could somebody tell me a quick way to write a whole byte array to a 1
bit per pixel bitmap if its possibleinstead of locking the bits and
doing it like that.....

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 16 '05 #1
1 3629
James,

I would create a new MemoryStream instance, passing the byte array to
the stream. Once you do this, you can pass the MemoryStream instance to the
constructor of the Bitmap class, and it should read the contents from the
array to construct your bitmap.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"James Dean" <m_*******@yahoo.com> wrote in message
news:ed**************@TK2MSFTNGP15.phx.gbl...
Could somebody tell me a quick way to write a whole byte array to a 1
bit per pixel bitmap if its possibleinstead of locking the bits and
doing it like that.....

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 16 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: iyuen | last post by:
I'm having problems with converting a byte array to an image object~ My byte array is an picture in VB6 StdPicture format. I've used propertybag to convert the picture into base64Array format in...
3
by: James Dean | last post by:
I have read that you can create a 1bpp png image but has anyone any idea how to do it?...... *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in...
0
by: James Dean | last post by:
I save a 1bpp bitmap as a 1bpp png......i save this 1bpp png in a memorystream.....problem is i want to convert this back to a 1bpp bitmap but it always saves as a 32bpp bitmap....i need the 1bpp...
0
by: CroDude | last post by:
Hi all! I have problems when writting bitmap to a byte array and after reading it back form byte to Bitmap object. What I do is this: First I throw Bitmap to a memory-stream and then I write it...
9
by: Sharon | last post by:
I'm trying to convert an Image file to a byte array . Later in my code I'm trying to create a new Image from this byte array as a restored Image. But when I try to save the restored Image to a...
1
by: Sharon | last post by:
I have 2 questions that are just the opposite to one another: (1) I need to read an image file (like bitmap, jpeg etc.) and to save only its data, I need to save his data in a raw data format,...
3
by: Sharon | last post by:
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...
1
by: Sauny | last post by:
Hi all, Ok, I am not the best C programmer in the world but am looking to convert a byte array which contains pixel information to a bitmap. basically i have a screen say 320x280 leading to a...
2
by: Laurent Navarro | last post by:
Hello, I am using a library which returns a byte containing RAW data, ie all pixels' color values coded in a byte array without header. I would like to save those data into a JPEG file so I...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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.