News:

GinGly.com - Used by 85,000 Members - SMS Backed up 7,35,000 - Contacts Stored  28,850 !!

Main Menu

GDI Primitives

Started by sukishan, Jul 12, 2009, 06:45 PM

Previous topic - Next topic

sukishan

The types of graphics displayed on the screen can themselves be divided in to several categories, which are called primitives. These are:

Bitmaps: A bitmap is an array of bits that represent the attributes of the individual pixels in an image (1 bit per pixel in a black-and-white display, multiple bits per pixel in a color or grayscale display). This is used to display complex images on the monitor
or printer. Bitmaps are also used to display small images such as icons, mouse cursors and buttons that appear in the toolbar.

Text: A Win32 macro that exists so that code can be compiled either as American National Standards Institute (ANSI) text or as Unicode. For Windows, which supports only Unicode, the macro forces the compiler to convert ANSI characters to Unicode characters. For example, passing the ANSI string "Hello Windows '' through the TEXT macro converts all characters in the string to 16-bit wide characters.

Lines and Curves: A line is a set of highlighted pixels on a video display (or a series of dots on a printed page) that is defined by two points: a starting point and an ending point. GDI supports straight lines, rectangles, ellipses, arcs that are partial curves on the ellipse and Bezier splines. Different type of curve can be drawn as a polyline which is a series of very short lines that define curve. Furthermore GDI draws lines using pen selected in the device context.

Filled areas: To sketch or fill in areas of a drawing with the color and pattern, brush is the tool used. Paint programs that offer a variety of brush shapes can produce brushstrokes of varying width and, in some cases, shadowing or calligraphic effects. A brush can be solid color, a pattern (which can be a series of horizontal, vertical or diagonal hatch marks) or a bitmapped image that is repeated vertically or horizontally within the area.
A good beginning makes a good ending