[Gambas-user] PictureBox not refresh copied image.

Benoît Minisini gambas at ...1...
Tue Jan 26 08:11:56 CET 2010


> Demosthene,
> 
> The way I got my picturebox to work is this
> 
> PictureBox1.Picture =
> Picture.Load("/usr/share/pixmaps/wicd/wicd-client.png")
> 
> so if you could try changing your code to this:
> 
> ...

Yes, Picture[...] actually loads the picture into an internal cache that is 
never automatically refreshed.

You can refresh the cache by assigning Picture[] with Picture.Load, this way:

  PictureBox1.Picture = Picture[s1] 'load Algiz.png
  Message("pic1")
  KILL s1 'delete Algiz.png
  COPY s2 TO s1 'copy Raido.png and rename it to Algiz.png
  'PictureBox1.Refresh <-- normally useless, unless there is a bug
  Picture[s1] = Picture.Load(s1) ' Refresh the cache entry
  PictureBox1.Picture = Picture[s1]

Regards,

-- 
Benoît Minisini




More information about the User mailing list