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/pgsettranslation.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/pgsettranslation.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/pgsettranslation.html on line 8
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/pgsettranslation.html on line 8
Translate draw commands horizontally and vertically
void PgSetTranslation ( PhPoint_t const *translation,
int flags );
void PgSetTranslationCx ( PhGC_t *gc,
PhPoint_t const *translation,
int flags );
ph
These functions cause all subsequent draw commands to be
translated by translation->x
pixels horizontally and
translation->y pixels vertically.
The default translation is (0,0).
You can set flags to:
- 0
- The translation is absolute, and replaces the current
one.
- Pg_RELATIVE
- The translation is relative to the current translation,
and is added to it.
PgSetTranslation() works on the current graphics context,
while you can specify the graphics context gc for
PgSetTranslationCx().
Draw a square from (100,100) to (200,200):
PhPoint_t translation;
PgSetFillColor( Pg_RED );
translation.x = translation.y = 100;
PgSetTranslation( &translation, Pg_RELATIVE );
PgDrawIRect( 0, 0, 100, 100, Pg_DRAW_FILL );
Photon
Safety: | |
Interrupt handler |
No |
Signal handler |
No |
Thread |
No |
PgClearTranslation*(),
PhPoint_t
“PtRaw widget”
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/pgsettranslation.html on line 128
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/pgsettranslation.html on line 128