Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

How to save a picture by pixels in c BGI mode to a file???

tedd21tedd21 Posts: 1Member
some one do help me.... i need to save the picture on my Paintbrush(which i made using C in BGI mode) drawing area to a file.. can anyone help me in that????
it is very urgent...
i think we have to do it pixell by pixel...but how to do it???//

Comments

  • MT2002MT2002 Posts: 1,444Member
    : some one do help me.... i need to save the picture on my
    : Paintbrush(which i made using C in BGI mode) drawing area to a
    : file.. can anyone help me in that????
    : it is very urgent...
    : i think we have to do it pixell by pixel...but how to do it???//
    :

    Yes, it is useually done pixel by pixel (or looped memcpy()'s),
    but this depends on the current video mode in order to copy
    it currectly.

    If you already have the image in memory, just write it to a file
    following the file format you want to use (or just dump it as
    a raw image) ...A simple fwrite() (or fstream::write() will do the
    trick.

    Or, if its really *That* urgent, with the program running press
    ctrl+prtscr (or alt+prtscr), Open an image editing program and paste
    it :-)

    btw, there is no "C BGI Mode". BGI is a Borland extension
    for support of graphics, and is Borland specific.
    I dont use BGI as it being old and nonportable.
Sign In or Register to comment.