473,326 Members | 2,136 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,326 software developers and data experts.

How to convert System.Drawing.BitMap to Byte[]?

As Title.

Thanks in advance.

David
Nov 16 '05 #1
3 7067
david <da********@lycos.com> wrote:
As Title.

Thanks in advance.


Use the inherited Image.Save method and save it to a MemoryStream which
you can then call ToArray on.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 16 '05 #2
You can query the BitmapData which has a pointer in it. This requrires
unsafe code, but you can access the bitmap bits directly.

--
cody

Freeware Tools, Games and Humour
http://www.deutronium.de.vu || http://www.deutronium.tk
"david" <da********@lycos.com> schrieb im Newsbeitrag
news:eP**************@TK2MSFTNGP11.phx.gbl...
As Title.

Thanks in advance.

David

Nov 16 '05 #3
Thanks a lot.
"cody" <no****************@gmx.net> wrote in message
news:e4**************@TK2MSFTNGP11.phx.gbl...
You can query the BitmapData which has a pointer in it. This requrires
unsafe code, but you can access the bitmap bits directly.

--
cody

Freeware Tools, Games and Humour
http://www.deutronium.de.vu || http://www.deutronium.tk
"david" <da********@lycos.com> schrieb im Newsbeitrag
news:eP**************@TK2MSFTNGP11.phx.gbl...
As Title.

Thanks in advance.

David


Nov 16 '05 #4

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

Similar topics

0
by: Nicolas Guilhot | last post by:
Hi all ! I have a multi-page Tiff image file that I want to convert to PDF. To do so I am using iText library. The conversion is working, but the code execution is very different according to...
1
by: Fritz Switzer | last post by:
With two controls a PictureBox and another "PictureBox like" , Pic2, a control from a dll, I'm stuck on cannot implicity convert System.Drawing.Image to System.Drawing.Bitmap error. How do I...
6
by: hb | last post by:
Hi, Would you please give me some idea to convert/decode a Base 64 encoded GIF image string to a *.gif file in ASP.Net? Thank you hb
1
by: Daniel | last post by:
I have looked everywhere on the web for an answer to this and the only thing I can find is converting the image format when the file is present on the local filesystem. What I want to do is use a...
7
by: Scott Schluer | last post by:
Is there a way to use the Image class to convert a color photo (GIF or JPEG) to a B&W photo? Thanks, Scott
2
by: cosminb | last post by:
I have a native function which returns an image in the form of a BYTE* lpDIB array. How do I convert it to a Bitmap, so that I can work with it properly in C#? Thanks in advance, Cosmin
1
by: Sugan | last post by:
Hi all, I'm creating a custom button control. I need to show a color image when the button control is enabled and a gray shade of the same image when the button control is disabled. How can i...
3
by: forest demon | last post by:
for example, let's say I do something like, System.Diagnostics.Process.Start("notepad.exe","sample.txt"); if the user does a SaveAs (in notepad), how can i capture the path that the user...
2
by: Bill Fuller | last post by:
I have a Bitmap (bm) that I am able to save using, for example, bm.Save("file.jpg", System.Drawing.Imaging.ImageFormat.Jpeg). However, I would like to convert this to a byte array (byte). What is...
14
by: Joe | last post by:
this file is drawn in VB.NET and input output goes by XmlSerializer. Therefore, simple output file looks like: <?xml version="1.0" encoding="utf-8"?> <DrawablePicture...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.