[Gambas-user] gb3: bug using Draw and DrawAlpha with imlib component

Kevin Fishburne kevinfishburne at ...1887...
Sun Feb 6 03:42:41 CET 2011


This code (project attached):

   Dim image1 As Image = New Image(128, 128, 0, 0)
   Dim image2 As Image = New Image(128, 128, 0, 0)
   Dim image3 As Image = New Image(128, 128, 0, 0)

   image1.Draw(image2, 0, 0)
   image1.DrawAlpha(image3, 0, 0)

produces the following runtime error:

"The source image and the destination image must have the same format"

The error does not occur when the order of the two draw statements is 
reversed. The problem still occurs when the images are loaded from file 
rather than explicitly created. Checking the properties of the two 
images shows identical results as far as I can tell.

Here's where things get really strange. If I open the property window 
for image1 (double-click the variable name) and step-execute (F8) the 
line "image1.Draw(image2, 0, 0)" it raises signal 11.

If I step-execute up to the last line, open the property window for 
image1, then step-execute the last line the DrawAlpha statement actually 
works...no error message at all. It's almost like just bringing up the 
property window modifies image1 such that DrawAlpha under imlib is made 
happy and doesn't throw the error.

-- 
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: gb3_test.tar.bz2
Type: application/x-bzip
Size: 5749 bytes
Desc: not available
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20110205/fd9d67cc/attachment.bin>


More information about the User mailing list