This seems so simple and I've done it before using the Image.RotateFlip method but this is for a predefined number of degrees (dependent upon how far the mouse has moved from its current position.
Here's what I have and I have no idea why it's not applying (the image doesn't move at all)
using (var g = Graphics.FromImage(pbProfile.Image))
{
g.TranslateTransform(pbProfile.Image.Width / 2f, pbProfile.Image.Height / 2f);
g.RotateTransform(Pixels);
}
pbProfile.Refresh();
I'm open to any and all suggestions as my brain is fried right now...
ANSWER
While the answer below is technically correct I found the actual solution to my problem here: Draw manipulated graphic into another graphic this explains that I don't need to be rotating the image I'm rotating but instead the graphic I'm writing it on.
Bitmap bmp = new Bitmap(pbProfile.Image.Width, pbProfile.Image.Height);
using (var g = Graphics.FromImage(bmp))
{
g.TranslateTransform(bmp.Width / 2f, bmp.Height / 2f);
g.RotateTransform(Pixels);
g.DrawImage(pbProfile.Image, 0, 0);
}
pbProfile.Refresh();