I need to mirror an image and display it like this:
To display like this:
This is my code so far, I have had no luck:
int Heigh
Image.RotateFlip will do the job at lot faster and easier:
Bitmap bmp1 = (Bitmap)pictureBox1.Image;
Bitmap bmp2 = new Bitmap(bmp1.Width * 2, bmp1.Height);
using (Graphics G = Graphics.FromImage(bmp2))
{
G.DrawImage(bmp1, 0, 0);
bmp1.RotateFlip(RotateFlipType.RotateNoneFlipX);
G.DrawImage(bmp1, bmp1.Width, 0);
pictureBox2.Image = bmp2;
}
Instead you could use loops similar to yours and Bitmap.GetPixel
and Bitmap.SetPixel
but that would be really slow:
TransformedPic.SetPixel(Width - i, j, TransformedPic.GetPixel(i,j));
Going over one half of the width..