I have been using mono for a short while and one of the issues I came upon was that loading an image into a CGImage object would end up with the image being flipped vertically. This was the code I was using originally:
public static CGImage LoadJPEG (string sImagePath, bool bSmoothImage)
{
return CGImage.FromJPEG (
new CGDataProvider (sImagePath), null, bSmoothImage,
CGColorRenderingIntent.Default);
}
There's a PNG version to that where you simply use CGImage.FromPNG instead, but if you use the wrong format with the wrong file type then you'll get an exception. As I always know what my file types are I didn't put any catches/checks to prevent that exception.
You'll notice just using this code will flip the image vertically, I can't explain why mono does this and having a look at some of the solutions I wasn't looking forward to fixing it.
So how to flip it back? Well, luckily I can answer that myself, but I can't vouch for it being the "correct" way to do it!