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:
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