Hello,
I have the following code;
IXpsOMMatrixTransform* rawGeomToPhys;
result = xpsObjectFactory->CreateMatrixTransform(&combinedMatrix, &rawGeomToPhys);
IXpsOMVisualCollection* pageVisuals;
result = page->GetVisuals(&pageVisuals);
result = pageVisuals->Append(scaleCanvas);
scaleCanvas->SetTransformLocal(rawGeomToPhys);
IXpsOMVisual* visual = NULL;
XPS_OBJECT_TYPE visualType;
UINT32 count;
UINT32 thisVisual;
pageVisuals->GetCount(&count);
thisVisual = 0;
while (thisVisual < count)
{
result = pageVisuals->GetAt(thisVisual, &visual);
result = visual->GetType(&visualType);
if (visualType == XPS_OBJECT_TYPE_CANVAS)
{
result = visual->SetTransformLocal(rawGeomToPhys);
}
if (NULL != visual) { visual->Release(); visual = NULL; }
thisVisual++;
}
If I remove the following line;
scaleCanvas->SetTransformLocal(rawGeomToPhys);
the scale and translate on the matrix takes effect; however, the pages are produced upside down and content is mirrored.
If I keep the aforementioned line of code, the scale and translate on the matrix has no effect; however, the pages produced come out scaled to the page size and in proper format (upside and not mirrored) (must be using a default value for the scaling and translation)
How can I keep;
scaleCanvas->SetTransformLocal(rawGeomToPhys);
in my code but still apply the matrix scale and translate which is something like;
combinedMatrix.scale(0.5, 0.5);
combinedMatrix.translate(y, x);