objective c - CGRectApplyAffineTransform not doing anything? -
i'm new cgaffine world. know why transformation doesn't work/take ?
i have valid pdfcontext created uigraphicsbeginpdfcontexttodata , following current matrix:
cgaffinetransform curmat = cgcontextgetctm(context); nslog (@"current context matrix: %f %f %f %f %f %f", curmat.a, curmat.b, curmat.c, curmat.d, curmat.tx, curmat.ty);nslog values:
current matrix: 1.000000 0.000000 -0.000000 -1.000000 0.000000 792.000000
i create transformation matrix with:
cgaffinetransform xform = cgaffinetransformmake(a, b, c, d, tx, ty);nslog values:
transform matrix: 0.062500 0.000000 0.000000 0.062500 0.000000 0.000000
i rect from:
cgrect pdfbounds = uigraphicsgetpdfcontextbounds();nslog values:
pdfbounds: 0.000000 0.000000 612.000000 792.000000
i apply transformation matrix with:
cgrectapplyaffinetransform (pdfbounds, xform);then re-check current matrix value with:
cgaffinetransform curmat2 = cgcontextgetctm(context); nslog (@"current context matrix after transformation: %f %f %f %f %f %f", curmat2.a, curmat2.b, curmat2.c, curmat2.d, curmat2.tx, curmat2.ty)and nslog values same @ beginning.
current context matrix after transformation: 1.000000 0.000000 -0.000000 -1.000000 0.000000 792.000000
what missing ? why transformation not happening/taking ? thank you.
you ignoring result of applied transformation , not applying transformation context.
step 7 should be:
cgcontextconcatctm(context, xform);
Comments
Post a Comment