kenetik
kenetik

Reputation: 350

Rotateflip image adding to image?

I have an image in a picture box, and when I do this in my code:

    pictureBox1.Image.RotateFlip(RotateFlipType.Rotate180FlipX);

The image has a black box on the right side of the picture box?

BEFORE

AFTER

Upvotes: 0

Views: 577

Answers (1)

Hans Passant
Hans Passant

Reputation: 941237

Hard to repro. For one, the PictureBox control has no idea that the image was changed, it won't even repaint it. At least do it like this so it knows:

        var img = pictureBox1.Image;
        img.RotateFlip(RotateFlipType.Rotate180FlipX);
        pictureBox1.Image = img;

Upvotes: 3

Related Questions