0

I have one image and i want to split this image and adding some extra to each split and then combine all image into one image.so i write this code :

     public void Slice()
    {
        using (MagickImageCollection images = new MagickImageCollection())
        {
            int overlap = cmtopx(1.1f);
            int sliceSize = cmtopx(11.3f);
            for (int i = 0; i < 8; i++)
            {
                MagickImage currentSlice = new MagickImage();
                    Rectangle rect = new Rectangle(i * sliceSize, 0, sliceSize + overlap, myImage.Height);
                    Bitmap im = myImage.Clone(rect, myImage.PixelFormat);
                    currentSlice.Read(im);
                    currentSlice.Page.X = i * sliceSize;
                    images.Add(currentSlice);
            }
            using (MagickImage result = images.Mosaic())
            {
                result.Write("test4.png");
            }
        }

     }

i have 8 split but at the end of method test4.png is last split of my image.i need a way that each split inserted beside each other in one image.

dlemstra
  • 7,813
  • 2
  • 27
  • 43
MBehtemam
  • 7,865
  • 15
  • 66
  • 108

0 Answers0