I'm using a ListView control to display pictures similarly to how
Windows Explorer displays pictures in "Thumbnails" view. The images are
stored in an ImageList component. I would like to provide the ability
to rotate the images and I'm having some issues.
Basically, what I've tried is:
lstViewImages.LargeImageList.Images[ItemIndex].RotateFlip(RotateFlipType.Rotate90FlipNone);
lstViewImages.Update();
And:
imageListThumbNails.Images[ItemIndex].RotateFlip(RotateFlipType.Rotate90FlipNone);
lstViewImages.Update();
Obviously, the first approach accesses the ImageList component through
the ListView control, whereas the second approach accesses the ImageList
component directly. The code should, in theory, rotate the image in the
ImageList component; however, viewing the image after calling the
RotateFlip() method displays the image in its original position.
I considered removing the original image and adding it again, but that
wasn't a viable solution because the imageListThumbNails.Images
collection does not provide an Insert() method that I could use to
specify the exact index that I wish the update image to be inserted. In
other words, I could only Add() the image to the end of the collection,
which would reorder everything.
Am I doing something wrong or is there another approach I should look into?
Thank you in advance,
--
Sean