Are there any mechanism within Windows Mobile programming to rotate a Bitmap?
I would like to rotate this to any angle.
Are there any mechanism within Windows Mobile programming to rotate a Bitmap?
I would like to rotate this to any angle.
You have to do this yourself in code, since RotateTransform isn't available in CF:
public Bitmap GetRotatedBitmap(Bitmap original)
{
Bitmap output = new Bitmap(original.Height, original.Width);
for (int x = 0; x < output.Width; x++)
{
for (int y = 0; y < output.Height; y++)
{
output.SetPixel(x, y, original.GetPixel(y, x));
}
}
return output;
}
SetPixel and GetPixel are absurdly slow; a faster way to do this is with the LockBits method (there are a number of questions on SO that show how to use this).