Tuesday, July 28, 2009

Please Provide me source code Of drawing a simple rectangle in Graphics programming through C?

The C language, by itself, does not provide any means of doing "graphics" programming.





Here's about the best you can do:





#include %26lt;stdio.h%26gt;


int main(int argc, char* argv[]) {


printf("+------+\n| |\n| |\n+------+\n");


return 0;


}





Now, if you want to get into "real" graphics programming, you'll need a toolkit. On Windows, the most common toolkit is MFC. MFC is actually a C++ wrapper around the C-based Win32.





If you're on Linux, you'll want to look into GTK+ (which is C based), Qt (C++), or, if you want to do really low-level GUI programming, Xlib (C).





Of course, there are countless other graphical toolkits for both platforms.


No comments:

Post a Comment