If you really want to zoom the image by repeating the pixels in loops, maybe with some colour replacement, then try this code too:
Color WriteColor, ChangeColor;
Bitmap FirstImage, LastImage;
FirstImage = pictureBox1.Image as Bitmap ?? new Bitmap( pictureBox1.Image );
int ImageWidth = FirstImage.Width;
int ImageHeight = FirstImage.Height;
const int Coefficient = 5;
LastImage = new Bitmap( ImageWidth * Coefficient, ImageHeight * Coefficient );
for( int x1 = 0, x2 = 0; x1 < ImageWidth; ++x1, x2 += Coefficient )
{
for( int y1 = 0, y2 = 0; y1 < ImageHeight; ++y1, y2 += Coefficient )
{
WriteColor = FirstImage.GetPixel( x1, y1 );
ChangeColor = WriteColor;
for( int x = x2; x < x2 + Coefficient; ++x )
{
for( int y = y2; y < y2 + Coefficient; ++y )
{
LastImage.SetPixel( x, y, ChangeColor );
}
}
}
}
pictureBox2.Image = LastImage;