Add Graphic Background A Application Dev C++

Posted By admin On 10.12.20
Add Graphic Background A Application Dev C++ Rating: 9,6/10 4124 reviews
  1. Add Graphic Background A Application Dev C 2017
  2. Add Graphic Background A Application Dev C For Pc

Hi pals,
I am a Newbie in C++ Programming field. I plan to add graphics.h header class in
Dev -C++ Version 4.9.9.2 from Bloodshed which is come along with Borland Compiler.
I follow the Steps in URL : http://www.uniqueness-template.com/devcpp/#step2

DEV-C for Windows contains all standard features necessary for creating, fixing, and executing programs written in C program languages. As C is an object-oriented expansion of C, it also supports earlier versions of the language. If you'd like to add GUI elements to your app I recommend to use an external framework. It would otherwise take a massive amount of work to start from scratch:). Since you didn't write which OS you're on, here is a list of platform-independent GUI libraries using c.

But I Got Error in the Sample code which test the Working , Please Help me
to get away from this problem . I am waiting to hear from you.

Regards
Anes P.A:'(

  • 13 Contributors
  • forum 14 Replies
  • 19,262 Views
  • 5 Years Discussion Span
  • commentLatest Postby leonesaLatest Post

WaltP2,905

Add Graphic Background A Application Dev C 2017

You can't. Auto tune 7 low latency. graphics.h is not compatible with Dev-C++

Add Graphic Background A Application Dev C For Pc

You can't draw images in console. You can however change the font/ background color.
The wrong way:
system('color fc'); sets text color as red and background color as white. Note that color will be changed i the whole console. Also, system isn't quite save.
The windows way:
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 0xfc); same color, but now, only text printed after this function was called will be colored. This allows multiple colors.
edit:
And now I'll explain how the colors work. You'll probably just google which color is which, but you migt find this interesting. Attribute is kept in a byte. 4 bits for background and 4 for text color. To represent this color hexadecimal numbers are used, since one hex digit represents 4 bits. For example 0x07. 0 is background color (black) and 7 is text color (gray).
If you write the 4 bits in binary they represent red, green and blue components. The first bit indicates whether the color is bright or dark.
examples:
0100 -> 0x4 -> dark red
1100 -> 0xC -> bright red
0111 -> 0x7 -> dark white (gray)
1000 -> 0x8 -> bright black (also gray, but slightly darker)
1101 -> 0xD -> bright purple
0001 -> 0x1 -> dark blue
and so on..
If you want a complete list of colors. A good place to find it is to write 'help color' in cmd.