Search code examples
delphirotationmetafile

Is it possible to rotate the metafile image without converting it to the bitmap?


I need to rotate the TMetafile image, at least by 90 degrees step. It is easy to rotate it by drawing my metafile on a bitmap canvas and then rotating the bitmap, but I would prefer to keep it in vector image format. Is this possible at all? If yes, then how can I do that?


Solution

  • Create a second metafile. Use SetWorldTransform to create the rotation transform. Draw the first metafile onto the second and let the transform do the rest.