Hi,
I've got a fast question, is there any possibility to check what kind of file is now loaded to for example my pictureBox1?
and another one, how can I remove image from pictureBox ? so later I can add there another one... Using null won't help :(
thanks
Greg.
PictureBox image check?
3 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Bechir BejaouiRank #144 · 15.9K pointsPosted Dec 11, 2008, 5:53 AM EST
strnig path = pictureBox1.ImageLocation;
For the second question
System.Drawing.Image image = System.Drawing.Image.FromFile(thenewpathhere);
pictureBox1.Image = image;
that's it
GaLaZ8 pointsPosted Dec 11, 2008, 6:12 AM EST
but now I have to face another problems with that...
1. I need to check if (in anyone of my pictureBoxes are the same pictures...)
if (pictureBox1.image = logo.gif && pictureBox2. image= logo.gif){}
how could I solve it?
second...
2. I've got four picture Boxes with loaded in images. Next I need to remove te pictures, and make sure that those pictureBoxes are ready to load in new images :)
thanks for help again
Bechir BejaouiRank #144 · 15.9K pointsPosted Dec 11, 2008, 1:13 PM EST
you do as follow
ImageList oImgList = new ImageList();
oImgList.Items.Add(Image1);
.
.
oImgList.Items.Add(Imagen);
then you can refer your images by the index, I mean
if(PictureBox.Iamge = oImgList.Images[index1] ..... patati patata barwet barwet.....
;-{)