Archived

This topic is now archived and is closed to further replies.

Bmp files

This topic is 5235 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey all, The win programming book i''m learning from don''t explain the part i need which is how can i save something on the screen to a .bmp or .jpeg? Like let''s say in paint there is the option "save as" which saves this file formats. Where i can find a tutorial about that? Thanks in advance

Share this post


Link to post
Share on other sites
for bitmaps, you basically have to build a couple of headers first, and then tack on the matrix of pixels. Look up BITMAPFILEHEADER and BITMAPINFOHEADER for Win32 programming.

As for jpeg, jpeg is a compression scheme, and requires that you run the data through a (I would assume) complex formula to reduce the size of the data. After that, you also create headers and then tack on the compressed data.

It''s my understanding that to write a program that uses jpeg compression, you need a liscence, as it is a patented formula.

generally, finding tutorials is as easy as saying "Google, google, big and small, what''s the finest tutorial of all". Here''s a hint, you want to know about file formats, why don''t you try search for "BMP file format specification"


Do you use your powers for good or for awesome?
My newly updated site | The Cutter Project | Association of Computing Machinery

Share this post


Link to post
Share on other sites
There are also classes built into GDI+ that will save in BMP,JPG,GIF, and PNG. check out the MSDN page on GDI+. I recomend learning how to do it on your own first like capn_midnight suggested for BMPs at least but once you can do BMPs it is a matter of decoding/encoding using the correct image format library.

Share this post


Link to post
Share on other sites
quote:
Original post by capn_midnight
It''s my understanding that to write a program that uses jpeg compression, you need a liscence, as it is a patented formula.

That''s GIF (Unisys).

Share this post


Link to post
Share on other sites