update: this issue starts when the size of image drawn is 3000x3000 or more and rotated. What happens to metafiles when they are rotated. Do they lose their vector advanatages and require as much memory as a bitmap. My suspicion
is an out of memory error is occuring, but not being reported.
I have large Metafile (4000x4000 pixels), and need to provide ability to rotate and scale image. I have external process (3rd party) that renders the image as an Image.Metafile. I need to create a rotated version of this image and then paint
int on a new graphics. To do so, I am creating a new rotated metafile (see code below - RotateDimensions will rotate around origin). Then I am painting this new image to the current graphics context, using Graphics.DrawImage(image,
0, 0). I tried many different overloaded calls to DrawImage, but each time the following happens:
- at 180 degrees, the image is always pixolated
- at 90 and 270 degrees, the image disappears when it becomes large (due to zooming)
- it is always fine at 0 degrees.
No errors are thrown. Please help with advice.