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

Kevin Fishburne kevinfishburne at ...1887...
Sun May 1 03:00:48 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.

-- 
Kevin Fishburne
Eight Virtues
www: http://sales.eightvirtues.com
e-mail: sales at ...1887...
phone: (770) 853-6271

-------------- next part --------------
A non-text attachment was scrubbed...
Name: DarthNo.jpg
Type: image/jpeg
Size: 91593 bytes
Desc: not available
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20110430/41d9bf6a/attachment.jpg>


More information about the User mailing list