コード例 #1
0
        private void buttonCreate_Click(object sender, EventArgs e)
        {
            if (background != null && imageBW != null)
            {
                Bitmap result = (Bitmap)background.Clone();
                int[,] depths = new int[imageBW.Width, imageBW.Height];
                for (int y = 0; y < imageBW.Height; y++)
                {
                    for (int x = 0; x < imageBW.Width; x++)
                    {
                        depths[x, y] = imageBW.GetPixel(x, y).R *CycleWidth / 255 / 6;
                    }
                }

                for (int y = 0; y < Height; y++)
                {
                    for (int x = CycleWidth; x < Width; x++)
                    {
                        if (depths[x - CycleWidth, y] > 0 && x + depths[x - CycleWidth, y] < Width)
                        {
                            Color c = result.GetPixel(x + depths[x - CycleWidth, y], y);
                            for (int i = x; i < Width; i += CycleWidth)
                            {
                                result.SetPixel(i, y, c);
                            }
                        }
                    }
                }

                FormImage form = new FormImage(result);
                form.Show();
            }
        }
コード例 #2
0
 private void pictureBoxImage_Click(object sender, EventArgs e)
 {
     if (imageBW != null)
     {
         FormImage form = new FormImage(imageBW);
         form.Show();
     }
 }
コード例 #3
0
 private void pictureBoxBackground_Click(object sender, EventArgs e)
 {
     if (background != null)
     {
         FormImage form = new FormImage(background);
         form.Show();
     }
 }