[Gambas-user] Picture box problem

Benoit Minisini gambas at ...1...
Fri Feb 8 13:27:27 CET 2008


On vendredi 8 février 2008, Mukul Khullar wrote:
> Thank you all for my previous Shell command query. I have another problem.
> Actually, I am generating some kind of image file for my project which
> changes according to the option selected on my GUI. I am displaying it
> using a picture box.
> But the problem is that, since I am giving the path of the image file, it
> doesn't refresh and shows the last image(maybe cached)itself.
> I tried to use picturebox.refresh , even main form.refresh, but to no use.
> I suppose, the picture box takes the image into a buffer, and next time if
> the same path is specified, it uses the same image(the name of the image
> being the same). But, since the image file is changing on the hard disk, it
> should take the refreshed path(image file).
> How can I do the same? I hope i've been able to describe my problem.
>
> P.s In short, the path given on the picturebox.picture property loads the
> same image file, even when the picturebox.picture property is set
> again(with the same path,though refreshed image file). Please help.
> Thanks once again,
> Mukul Khullar.
>

If you use Picture[] to get your images, you actually use an internal cache. 
So, you must reassing the image in the cache by using Picture["xxx"] = 
Picture.Load("xxx"), or, better, you should not use the cache for images that 
could change, i.e. just use Picture.Load().

Regards,

-- 
Benoit Minisini




More information about the User mailing list