Lets say I have 1 image Im looking for a way to have it in equal parts left from right I have this code however it cuts in long pieces:
var image = pictureBox1.Image;
var splitInto = 12;
using (var originalImage = new Bitmap(image))
{
for (int i = 0; i < splitInto; i++)
{
var rect = new Rectangle(0, originalImage.Height / splitInto * i, originalImage.Width, originalImage.Height / splitInto);
using (var clonedImage = originalImage.Clone(rect, originalImage.PixelFormat))
clonedImage.Save(directory + $"\\PageImage{i + 1}.jpg");
}
}
Im looking for the result o look like this:
[ ] [ ] [ ] [ ]
[ ] [ ] [ ] [ ]
[ ] [ ] [ ] [ ]
Where each square is connecting piece to the image I thought about 2 for loops but i cant figure it out.