[Gambas-user] gb3: recent changes to PaintImage and DrawImage

Benoît Minisini gambas at ...1...
Sun May 1 03:05:56 CEST 2011


> On 04/30/2011 08:46 PM, Benoît Minisini wrote:
> >> It seems the destination width/height parameters have been removed from
> >> these two methods in a recent gb3 revision. Is there an alternate way to
> >> scale a subset of the source image to the target image? 90% of my code
> >> doesn't scale it at all but scaling is still necessary for some
> >> operations.
> > 
> > I screwed up. It was removed from gb.image.imlib, because gb.image cannot
> > scale images. But gb.gtk and gb.qt4 know how to scale and paint at the
> > same time. So I should have kept the gb.image.imlib feature, and tried
> > to fix gb.image instead.
> > 
> > I will find a solution..
> 
> It's okay. I screw up about 50 times a day usually. :)
> 
> I was in the process of converting my code to the new syntax and tried
> this instead so scaling would work:
> 
> Old:
> 
> belevation.PaintImage(dshading, 0, 0, tgsize * 128, tgsize * 128,
> Fix(cx) - tgoffset, Fix(cy) - tgoffset, tgsize, tgsize)
> 
> New:
> 
> belevation.PaintImage(dshading.Resize(tgsize * 128, tgsize * 128), 0, 0,
> Fix(cx) - tgoffset, Fix(cy) - tgoffset, tgsize, tgsize)
> 
> While that doesn't throw an error, I can't tell if it's working because
> despite converting my code to remove the destination size parameters the
> graphics are totally f'cked up (attached). Crazy, no?
> 
> Even with the mistake, should this be working or am I doing something
> wrong? And one final question, what was the revision number before that
> change? I have some new, unrelated code that I need to test.

I fixed Image.PaintImage() in gb.image.imlib, so your code should work again.

Now let's try to fix gb.image...

-- 
Benoît Minisini




More information about the User mailing list