Archived

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

cleves

Bmp files

Recommended Posts

cleves    148
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
capn_midnight    1707
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
evillive2    779
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
EL    122
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
PhiberOptic    128
Also, check out PNG.. It''s free and does support transparency! =)

----------------------------------------------
Petter Nordlander

"There are only 10 kinds of people in the world. The who understand binary and those who don''t"

Share this post


Link to post
Share on other sites