Re: Save BMP images through C



On 2006-02-13, Niks <nbokare@xxxxxxxxx> wrote:

i wanted to know if there is any way to save and open BMP images
through C.I wanteed to interact with some images through C.

You most certainly can manipulate any file you want with C. The language
provides facilities for opening, reading and wrtiting files. Try reading
about fopen, fread, fwrite and similar functions of the standard C
library, or fgets, fputs, fprintf, etc for text-based I/O.

Of course C works with simple byte streams, not knowing anything, nor
imposing any specific structure on files, so you will have to either
implement the parsing of the bmp format yourself (by using the file i/o
functions provided by C), or find some code that does this job for you,
and use it.

In an off-topic comment, if you just want to interface with other image
manipulation/loading programs and you don't necessarily need the "bmp"
format but any one will do, try reading about "ppm" or "portable pixmap"
which is an extremely simple format to read and write.

--
John Tsiombikas (Nuclear / Mindlapse)
nuclear@xxxxxxxxxxxx
http://nuclear.demoscene.gr/
.



Relevant Pages

  • Re: IE only bmp, no jpg etc also scripting error
    ... regsvr32 /i shimgvw.dll " ... only managing to save as bmp, I was not able to locate the bmp anywhere other ... user profile, folder by foldr all the while checking to see what file ... > 810978 - Internet Explorer Saves Images As Bitmaps ...
    (microsoft.public.windows.inetexplorer.ie6.browser)
  • RE: Hiding Data in jpg or bmp files
    ... Catch me if I am wrong, since i am no expert in the area of images. ... Each pixel in a BMP with 16M colors is made up of 3 bytes, one each for Red, ... "Kahuna" wrote: ... > dont understand how a security data string could be encoded into the file ...
    (microsoft.public.vb.general.discussion)
  • Re: COMPARE 2 BMP files where one is offset
    ... >i have original complete bmp file. ... > the images being compared are faces, but rather say a picture of a letter, ... the other or can the bleed extend outside the area of the first? ... You may want to have a look at the thread "Improving Performane to compare ...
    (microsoft.public.vb.winapi.graphics)
  • Re: Graphics wont save........
    ... Internet Explorer Saves Images As Bitmaps (.bmp Files) ... Replies are posted only to the newsgroup for the benefit or other readers. ... > * This issue may occur if your Temporary Internet pages cache is full. ...
    (microsoft.public.windows.inetexplorer.ie6.browser)
  • Re: How to prevent write from attaching the bytes 0D 0A?
    ... subroutines text file I/O, as opposed to binary file I/O. ... TeX implementations like TeXLive and MikTeX appear to do the same. ... include your images, use a self extracting zip file. ...
    (comp.text.tex)