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

Howdy, Stranger!

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

Categories

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.