Microsoft Windows CE 3.0  

GPELineParms

Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

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 Functionfor 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 stylemember.

Remarks

The style, styleState, and mixmembers work together to define the pattern of pixels that are drawn along the line's length. The mixmember 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 stylemember is treated as a 32-bit pattern of alternation between the ROP values in mix. The bits that are set in stylecorrespond to the "on" ROP2, while the unset bits correspond to the "off" ROP2. For example, a stylevalue 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 styleStatemember acts as an offset into style. That is, if styleStatewere set to 12, then the pattern of alternating ROP2 values would start with whatever ROP2 is specified by the 12 thbit in style.

It can be useful to specify a non-zero value for styleStateif 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 stylemember 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 xfor styleStatesuch that the x thand ( x+cPels mod 32) thbits in styleare set. For example, if cPels were 48, and style were 0xF0F0F0F0, then a value of 2 would suffice. Often, many such styleStatevalues 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 styleStatemember can also be used to make a stylepattern 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

© 2004 Microsoft Corporation. All rights reserved.