This topic has not yet been rated Rate this topic

GPELineParms

Windows CE 3.0

This structure controls line drawing for GPE and display drivers. Some of the members of GPELineParms come from applications, while GPE calculates and sets the rest.

struct GPELineParms {
SCODE (GPE::*pLine)(GPELineParms *);
long xStart;
long yStart;
int cPels;
unsigned long dM;
unsigned long dN;
long llGamma;
int iDir;
unsigned long style;
int styleState;
GPESurf *pDst;
COLOR solidColor;
RECTL *prclClip;
unsigned short mix;
};

Members

pLine
A pointer to a GPE::Line function.
xStart
Starting horizontal point of the line.
yStart
Starting vertical point of the line.
cPels
Length in pixels of the line in the major direction.
dM
The larger of the lengths of the line in the horizontal and vertical directions, calculated in 1/16ths of a pixel.
dN
The smaller of the length of the line in the horizontal and vertical directions, calculated in 1/16ths of a pixel.
llGamma
Typically, the initial starting value for the slope iterator.
iDir
The octant number for the line. See Accelerated Line Segment Function for a chart of the octant numbers.
style
Line attributes, such as solid or dashed.
styleState
The state of the line style in the current path, measured in pixels.
pDst
A pointer to the line's destination surface.
solidColor
The brush color.
prclClip
A clipping rectangle.
mix
A two-byte value consisting of two different ROP2 values, which are alternated between according to the bit pattern in the style member.

Remarks

The style, styleState, and mix members work together to define the pattern of pixels that are drawn along the line's length. The mix member specifies two ROP2 values, one in each byte. The first byte can be thought of as the ROP2 for pixels in the line that are "on", while the second is for pixels that are "off". The style member is treated as a 32-bit pattern of alternation between the ROP values in mix. The bits that are set in style correspond to the "on" ROP2, while the unset bits correspond to the "off" ROP2. For example, a style value of 0xF0F0F0F0 would alternate between the ROP2 values in four-pixel groups, since the bit pattern consists of alternating groups of four ones and four zeros. Finally, the styleState member acts as an offset into style. That is, if styleState were set to 12, then the pattern of alternating ROP2 values would start with whatever ROP2 is specified by the 12th bit in style.

It can be useful to specify a non-zero value for styleState if you need to ensure that both ends of a line are drawn with the same ROP2 value. For example, if the "off" ROP2 corresponds to the window's background color, and the style member is 0xF0F0F0F0, then a visual error of as much as 4 pixels would be possible depending on the line's exact length. To avoid such errors, find a value x for styleState such that the xth and (x+cPels mod 32)th bits in style are set. For example, if cPels were 48, and style were 0xF0F0F0F0, then a value of 2 would suffice. Often, many such styleState values will suffice, and the choice can be made on other criteria, such as how many "on" bits will actually be drawn on each end of the line. The styleState member can also be used to make a style pattern appear continuous while drawing several line segments that are connected end-to-end.

Requirements

Runs on Versions Defined in Include Link to
Windows CE OS 1.0 and later gpe.h    

 Last updated on Tuesday, July 13, 2004

© 1992-2000 Microsoft Corporation. All rights reserved.

Did you find this helpful?
(2000 characters remaining)