The instance code is as follows:
Ras.reset ();
Agg::ellipse ell (400,400,20,70);
Coordinate transformation
Agg::trans_affine MTX;
Mtx.scale (0.5,1); The x-axis shrinks to half the original.
Mtx.rotate (agg::d Eg2rad (30));//Rotate 30 degrees
Mtx.translate (200,200);//x,y coordinates translate 100 respectively
typedef agg::conv_transform<agg::ellipse> ELL_CT_TYPE;
Ell_ct_type Ctell (ELL,MTX); Matrix transformations
typedef agg::conv_stroke<ell_ct_type> ELL_CC_CS_TYPE;
Ell_cc_cs_type Csccell (Ctell);
Ras.add_path (Csccell);
Agg::render_scanlines_aa_solid (Ras,sl,renb,agg::rgba8 (255,0,0));
Ras.reset ();
This is one of the most classic examples of use on the web, but it does not show how the rotation is implemented and slightly modifies the code:
Mtx.rotate (agg::d Eg2rad (60));//Rotate 60 degrees
Found nothing on the interface, the ellipse is gone!! At least you should speculate on the effect of rotation, otherwise who dares to use!!!
When modified to 40, view the graphics moved to (73,848) near, not found from the Internet
Any information.
Agg::trans_affine Coordinate conversion