[Gambas-user] Is this a bug

Wolfgang dl7nb at ...17...
Fri Jan 31 10:52:15 CET 2014


Hello all,

I found a strange behaviour with opacity.

Example:
Public Sub ButtonStart_Click()
Dim img1, img2 As Image
Dim i As Integer

   'let us load an image to img1
   img1 = Image.Load("data/map.png")


   For i = 1 To 20
       img2 = img1
       img2.Opacity(0.9)
       PictureBox1.Picture = img1.Picture
       PictureBox2.Picture = img2.Picture
       Wait 0.2
   Next

End

1. I load an image to "img1" and copy it to "img2".
2. Then I change the opacity of img2 to 90%.
3. I display both images in my form.
4. I repeat this 20 times.

What I expect:
is that img1 should show the original visual impression and img2 show a 
lighter version of it

What I get:
*BOTH* images get lighter and lighter with each loop. *Both* images are 
totally blurred out and the end of the loop.

How comes? Did I misunderstand "Opacity"? Why can't I change only one 
image's opacity?

Greeting from Bavaria

Wolfgang

I have added the project.
  Here is the system Information:

[System]
Gambas=3.5.2
OperatingSystem=Linux
Kernel=3.5.0-45-generic
Architecture=x86
Distribution=Ubuntu 12.04.4 LTS
Desktop=GNOME
Theme=QGtk
Language=de_DE.UTF-8
Memory=2000M
[Libraries]
Cairo=libcairo.so.0.0.0
Cairo=libcairo.so.2.11000.2
Curl=libcurl.so.4.2.0
DBus=libdbus-1.so.3.5.8
GStreamer=libgstreamer-0.10.so.0.30.0
GStreamer=libgstreamer-1.0.so.0.1.0
GTK+=libgtk-x11-2.0.so.0.2400.10
OpenGL=libGL.so.1.2.0
Poppler=libpoppler.so.19.0.0
Qt4=libQtCore.so.4.8.1
SDL=libSDL-1.2.so.0.11.3
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.tar.gz
Type: application/x-gzip
Size: 58731 bytes
Desc: not available
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20140131/819c47ff/attachment.bin>


More information about the User mailing list