Beginner C/C++

Moderators: None (Apply to moderate this forum)
Number of threads: 5432
Number of posts: 16953

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
How to save a picture by pixels in c BGI mode to a file??? Posted by tedd21 on 31 May 2007 at 12:14 PM
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???//
Report
Re: How to save a picture by pixels in c BGI mode to a file??? Posted by MT2002 on 31 May 2007 at 4:47 PM
: 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.



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.