Saturday, November 5, 2011

Summary of Graphics Under Windows in C programming language

(a) In DOS, programmers had to write separate graphics code for every new video adapter. In Windows, the code once written works on any video adapter.
(b) A Windows program cannot draw directly on an output device like screen or printer. Instead, it draws to the logical display surface using device context.
(c) When the window is displayed for the first time, or when it is moved or resized OnPaint( ) handler gets called.
(d) It is necessary to obtain the device context before drawing text or graphics in the client area.
(j)
A device context is a structure containing information required to draw on a display surface. The information includes color of pen and brush, screen resolution, color palettes, etc.
(e) To draw using a new pen or brush it is necessary to select them into the device context.
(f) If we don’t select any brush or pen into the device context then the drawing drawn in the client area would be drawn with the default pen (black pen) and default brush (white brush).
(g) RGB is a macro representing the Red, Green and Blue elements of a color. RGB ( 0, 0, 0 ) gives black color, whereas, RGB ( 255, 255, 255 ) gives white color.
(h) Animation involves repeatedly drawing the same image at successive positions

No comments:

Post a Comment