help with opening image file

Discussion in 'C Programming' started by albo, Dec 23, 2006.

  1. albo

    albo Guest

    hi all !!
    i need help in opening an image file (bmp)
    and printing it to the screen.

    thanks
     
    albo, Dec 23, 2006
    #1
    1. Advertising

  2. albo

    fool Guest

    In article <>,
    says...
    > hi all !!
    > i need help in opening an image file (bmp)
    > and printing it to the screen.
    >
    > thanks


    Use fopen and FILE pointer to open the file. The .bmp file starts with BM
    in the first two bytes. While reading the file, if the BM string is first
    2 bytes then print the file in the screen. If not then throw a error.
    Take care while doing the file operations and memory allocations. Hope
    this helps.
     
    fool, Dec 23, 2006
    #2
    1. Advertising

  3. albo said:

    > hi all !!
    > i need help in opening an image file (bmp)


    That bit's easy enough. The bitmap format is relatively well-documented and
    reasonably simple. You can find out about it in, say, "Programming
    Windows", 5th edition, by Charles Petzold, or you could try something like
    http://www.wotsit.org/

    So it's literally a question of opening the file using fopen, reading the
    various bits of header information, then loading and storing the bitmap
    information in some suitable data structure (I use an array of arrays of
    unsigned long, but that's not the only possible choice). Don't forget that
    bitmaps are sometimes (often, usually) stored the wrong way up.

    > and printing it to the screen.


    That's still pretty easy, but the exact details will depend on your
    implementation's graphics library provisions. Consult a newsgroup that
    deals with your implementation.

    --
    Richard Heathfield
    "Usenet is a strange place" - dmr 29/7/1999
    http://www.cpax.org.uk
    email: rjh at the above domain, - www.
     
    Richard Heathfield, Dec 23, 2006
    #3
  4. albo

    albo Guest

    thanks a lot for the help !!
     
    albo, Dec 24, 2006
    #4
  5. albo

    Malcolm Guest

    "Richard Heathfield" <> wrote in message
    news:p...
    > albo said:
    >
    >> hi all !!
    >> i need help in opening an image file (bmp)

    >
    > That bit's easy enough. The bitmap format is relatively well-documented
    > and
    > reasonably simple. You can find out about it in, say, "Programming
    > Windows", 5th edition, by Charles Petzold, or you could try something like
    > http://www.wotsit.org/
    >
    > So it's literally a question of opening the file using fopen, reading the
    > various bits of header information, then loading and storing the bitmap
    > information in some suitable data structure (I use an array of arrays of
    > unsigned long, but that's not the only possible choice). Don't forget that
    > bitmaps are sometimes (often, usually) stored the wrong way up.
    >
    >> and printing it to the screen.

    >
    > That's still pretty easy, but the exact details will depend on your
    > implementation's graphics library provisions. Consult a newsgroup that
    > deals with your implementation.
    >

    Why is't there a loader available on the net?
    After all, one person needs to write a portable load routine once, and if
    he's done a competent job no one need ever worry about the details again.
    --
    www.personal.leeds.ac.uk/~bgy1mm
    freeware games to download.
     
    Malcolm, Dec 25, 2006
    #5
  6. albo

    Richard Bos Guest

    "Malcolm" <> wrote:

    > "Richard Heathfield" <> wrote in message
    > > albo said:
    > >
    > >> i need help in opening an image file (bmp)

    > >
    > > That bit's easy enough. The bitmap format is relatively well-documented
    > > and reasonably simple. You can find out about it in, say, "Programming
    > > Windows", 5th edition, by Charles Petzold, or you could try something like
    > > http://www.wotsit.org/


    > Why is't there a loader available on the net?


    Who says there isn't? Do a websearch.

    > After all, one person needs to write a portable load routine once, and if
    > he's done a competent job no one need ever worry about the details again.


    Hah. Not much experience with M$ shifting specs, have you?

    Richard
     
    Richard Bos, Dec 27, 2006
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?dHJlbGxvdzQyMg==?=

    HELP! HELP! HELP! Opening Web Application Project Error

    =?Utf-8?B?dHJlbGxvdzQyMg==?=, Feb 20, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    814
    =?Utf-8?B?dHJlbGxvdzQyMg==?=
    Feb 20, 2004
  2. Ria Van Heerden

    Opening a image in a new window

    Ria Van Heerden, May 13, 2004, in forum: HTML
    Replies:
    19
    Views:
    726
    Whitecrest
    May 13, 2004
  3. Laszlo Zsolt Nagy
    Replies:
    1
    Views:
    1,435
    Kartic
    Jan 26, 2005
  4. mcl
    Replies:
    2
    Views:
    687
  5. fniles
    Replies:
    0
    Views:
    301
    fniles
    Apr 26, 2009
Loading...

Share This Page