[Gtk-sharp-list] Changing image

Boyan Dzambazov dunamis at puzzleapps.org
Fri Jul 14 21:32:33 EDT 2006


Thanks for the fast replay, I tested it. And now i can change image like this:
Pixbuf image1 = new Pixbuf("./images/other.jpg");
img.Pixbuf = image1;

10x
Bobby


On Saturday 15 July 2006 00:57, Rafael Teixeira wrote:
> Sorry, to be clear a one-liner with your code for some context:
>
> <csharp>
> ScrolledWindow ImgWin = new ScrolledWindow();
> ImgWin.SetPolicy(PolicyType.Automatic, PolicyType.Automatic);
> Gtk.Image img = new Gtk.Image("./images/out.jpg");
> ImgWin.AddWithViewport(img);
>
> ...
>
> img.FromFile = "./images/other.jpg";
>
> ...
> </csharp>
>
> On 7/14/06, Rafael Teixeira <monoman at gmail.com> wrote:
> > Hi,
> >
> > I think you can use the FromFile property to load another image from a
> > file, or the FromPixbuf property to present it an already loaded, and
> > perhaps modified, image in memory.
> >
> > Hope it helps,
> >
> > On 7/14/06, Boyan Dzambazov <dunamis at puzzleapps.org> wrote:
> > > Hi All,
> > > I'm new to GTK# and I have some problems :)
> > > I'm trying to create ScrolledWindow add image to it and later change
> > > this image:
> > > ScrolledWindow ImgWin = new ScrolledWindow();
> > > ImgWin.SetPolicy(PolicyType.Automatic, PolicyType.Automatic);
> > > Gtk.Image img = new Gtk.Image("./images/out.jpg");
> > > ImgWin.AddWithViewport(img);
> > >
> > > This is working but I can't find a way to replace this image with the
> > > new one: ./images/out1.jpg
> > >
> > > Can anyone help?
> > >
> > > 10x
> > > Bobby
> > > _______________________________________________
> > > Gtk-sharp-list maillist  -  Gtk-sharp-list at lists.ximian.com
> > > http://lists.ximian.com/mailman/listinfo/gtk-sharp-list
> >
> > --
> > Rafael "Monoman" Teixeira
> > ---------------------------------------
> > "The reasonable man adapts himself to the world; the unreasonable one
> > persists in trying to adapt the world to himself. Therefore all
> > progress depends on the unreasonable man." George Bernard Shaw


More information about the Gtk-sharp-list mailing list