Example #1
0
        public void RenderImage(Bitmap bitmap, ImageView imageView)
        {
            var lockedBitmap = new LockBitmap(bitmap);
            lockedBitmap.LockBits();

            var width = imageView.Width;

            for (int i = 0; i < imageView.Height; i++)
                for (int j = 0; j < imageView.Width; j++)
                {
                    if (imageView.Pixels[i * width + j] != Color.FromArgb(0, 0, 0, 0))
                    {
                        lockedBitmap.SetPixel(j, i, imageView.Pixels[i * width + j]);
                    }
                }

            lockedBitmap.UnlockBits();
        }