我想我做到了:
double* pBounds = pImageData->GetBounds();
vtkCoordinate* pCoordinate = vtkCoordinate::New();
pCoordinate->SetValue(0, 0, 0);
pCoordinate->SetValue(pBounds[0], pBounds[2], 0);
int* pValueInt = pCoordinate->GetComputedDisplayValue(m_pRenderer);
TRACE("BottomLeft:x:%d - y:%d\n", pValueInt[0], pValueInt[1]);
pCoordinate->SetValue(pBounds[1], pBounds[3], 0);
pValueInt = pCoordinate->GetComputedDisplayValue(m_pRenderer);
TRACE("TopRight:x:%d - y:%d\n", pValueInt[0], pValueInt[1]);
pCoordinate->SetValue(pBounds[2], pBounds[4], 0);
pValueInt = pCoordinate->GetComputedDisplayValue(m_pRenderer);
TRACE("TopLeft:x:%d - y:%d\n", pValueInt[0], pValueInt[1]);
pCoordinate->SetValue(pBounds[4], pBounds[2], 0);
pValueInt = pCoordinate->GetComputedDisplayValue(m_pRenderer);
TRACE("BottomRight:x:%d - y:%d\n", pValueInt[0], pValueInt[1]);
pCoordinate->Delete();
我奇怪的是,如果以正確的方式來獲得圖像的角落...