void AffineTransformTestCase::Rotate90Clockwise() { wxBitmap bmpUsingMatrix(m_bmpOrig.GetHeight(), m_bmpOrig.GetWidth()); // build the rotated image using the transformation matrix { wxMemoryDC dc(bmpUsingMatrix); if ( !dc.CanUseTransformMatrix() ) return; wxAffineMatrix2D matrix; matrix.Rotate(0.5 * M_PI); matrix.Translate(0, -m_bmpOrig.GetHeight()); dc.SetTransformMatrix(matrix); dc.DrawBitmap(m_bmpOrig, 0, 0); } CPPUNIT_ASSERT_EQUAL( bmpUsingMatrix.ConvertToImage(), m_imgOrig.Rotate90(true) ); }