Re: More problems with gdk-pixbuf [UPDATE]



Loban Rahman wrote:
> 
> > > Now I've got this test code. What it ought to output is a window with
> > > a 4 by 4 grid of the xpm in title_xpm. Instead, the resulting image
> > > is somewhat garbled. If someone could compile it with
> >
> > >                         gdk_pixbuf_copy_area(title, 0, 0,
> > >                                              gdk_pixbuf_get_width(title),
> > >                                              gdk_pixbuf_get_height(title),
> > >                                              display, i * 8, j * 8);
> >
> > I've isolated the problem to this function. Apparently, if the x and y
> > coordinate on the destination pixbuf is not (0, 0), the copy messes up
> > and garbles what gets copies onto the destination pixbuf. I've tried both
> > 0.6.0 and 0.7.0 of gdk-pixbuf. Has anyone else noticed this?
> 
> I did some more experimenting: I replaced the copy_area function with
> its contents in the source, which is:
> 
>                         gdk_pixbuf_scale(title, display,
>                                          i * 8, j * 8,
>                                          gdk_pixbuf_get_width(title),
>                                          gdk_pixbuf_get_height(title),
>                                          i * 8, j * 8, 1, 1,
>                                          GDK_INTERP_NEAREST);
> 

This is also updating the x and y offsets. If you were to call it as
 gdk_pixbuf_scale(title, display,
  i * 8, j * 8,
  gdk_pixbuf_get_width(title),
  gdk_pixbuf_get_height(title),
  0, 0, 1, 1,
  GDK_INTERP_NEAREST);
it works fine.

I don't know whether the offsets should be set at all by
gdk_pixbuf_copy_area. A bug?

Jeff Grollo




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]