C++Talk.NET Forum Index C++Talk.NET
C++ language newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Re: How to write a Bitmap file

 
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ language (comp.lang.c++)
View previous topic :: View next topic  
Author Message
William Cleveland
Guest





PostPosted: Wed Jun 25, 2003 4:09 am    Post subject: Re: How to write a Bitmap file Reply with quote



A portable bitmap file (.pbm, usually) is a few header lines, followed
by a raw, two-dimensional array of bytes. Using system IO, you can
just write() your array of bytes with a single call, after you write
the header lines (probably with a sprintf call or the IO Streams
equivilant, followed by a single write() call for that buffer).

If you're talking about the Windows .bmp format, it's not really a
bitmap. It's complicated enough that you'll probably want to find
a library.

Bill


Yicheng Li wrote:
Quote:
Hi, I've got an array of byte values (300 by 300) that I'm trying to
output as a bitmap file. I'm on the Windows 2000 platform, and I was
hoping for some kind of API or library where I could just create a
bitmap file. Is there anything like this, or am I pretty much going
to have to manually write the byte by byte.

Thanks in advance,
YL


Back to top
D. Rush
Guest





PostPosted: Wed Sep 29, 2004 10:44 pm    Post subject: Re: How to write a Bitmap file Reply with quote



Here's some code that writes a bitmap. You can integrate the BitmapManager
class to build and save the bitmap pixel by pixel.

http://www.koders.com/cpp/fid7537D5C83DD56B396E00399B7636CFA11AB28FF4.aspx?s=2d+bmp+save

DR

"William Cleveland" <WCleveland (AT) Ameritech (DOT) Net> wrote

Quote:
A portable bitmap file (.pbm, usually) is a few header lines, followed
by a raw, two-dimensional array of bytes. Using system IO, you can
just write() your array of bytes with a single call, after you write
the header lines (probably with a sprintf call or the IO Streams
equivilant, followed by a single write() call for that buffer).

If you're talking about the Windows .bmp format, it's not really a
bitmap. It's complicated enough that you'll probably want to find
a library.

Bill


Yicheng Li wrote:
Hi, I've got an array of byte values (300 by 300) that I'm trying to
output as a bitmap file. I'm on the Windows 2000 platform, and I was
hoping for some kind of API or library where I could just create a
bitmap file. Is there anything like this, or am I pretty much going
to have to manually write the byte by byte.

Thanks in advance,
YL




Back to top
Display posts from previous:   
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ language (comp.lang.c++) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.