Warning: main(/www/www/htdocs/style/globals.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/photon/lib_ref/pg/pgdrawline.html on line 1
Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/globals.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/photon/lib_ref/pg/pgdrawline.html on line 1
Warning: main(/www/www/htdocs/style/header.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/photon/lib_ref/pg/pgdrawline.html on line 9
Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/header.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/photon/lib_ref/pg/pgdrawline.html on line 9
Draw a single line
int PgDrawLine( PhPoint_t const *p1,
PhPoint_t const *p2 );
int PgDrawILine( int x1, int y1,
int x2, int y2 );
int PgDrawLineCx( void *dc,
PhPoint_t const *p1,
PhPoint_t const *p2 );
int PgDrawILineCx( void *dc,
int x1, int y1,
int x2, int y2 );
ph
These functions build a command in the draw buffer to draw a line.
Note that PgDrawLine() and PgDrawLineCx() require two pointers to
PhPoint_t
structures, whereas
PgDrawILine() and PgDrawILineCx() take individual
arguments.
PgDrawLine() and PgDrawILine() work on the current
draw context, while you can specify the draw context dc
for PgDrawLineCx() and PgDrawILineCx().
- 0
- Success.
- -1
- The draw buffer is too small to hold the current draw state and
the draw command.
The following example:
DrawLines() {
PgSetStrokeColor( Pg_RED );
PgDrawILine( 8, 8, 152, 8 );
PgSetStrokeColor( Pg_GREEN );
PgDrawILine( 8, 8, 152, 60 );
PgSetStrokeColor( Pg_YELLOW );
PgDrawILine( 8, 8, 152, 112 );
}
will draw:
Photon
Safety: | |
Interrupt handler |
No |
Signal handler |
No |
Thread |
No |
PgSetStrokeCap*(),
PgSetStrokeColor*(),
PgSetStrokeDash*(),
PgSetStrokeDither*(),
PgSetStrokeJoin*(),
PgSetStrokeWidth*(),
PhPoint_t
“Drawing attributes”
and
“Lines, pixels, and pixel arrays”
in the Raw Drawing and Animation chapter of the
Photon Programmer's Guide
Warning: main(/www/www/htdocs/style/footer.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/photon/lib_ref/pg/pgdrawline.html on line 158
Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/footer.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/photon/lib_ref/pg/pgdrawline.html on line 158