PictureBox image not clearing

Post

Posted
Rating:
#1 (In Topic #141)
Avatar
Expert
Quincunxian is in the usergroup ‘Expert’
Greetings fellow Gambastions
I have a Picturebox component on a form that I wish to clear.
I've tried the following in my Form clean up routine…

Code (gambas)

  1.   If Not IsNull(Pic_Image.Picture) Then
  2.     Pic_Image.Picture.Clear
  3.     Pic_Image.Picture.Flush
  4.  

The Null test is required when the form first instantiates and does an initial clean up as there is no picture (Null)
Both the clear and flush lines are called when the PictureBox has a valid image and the form clean up routines are called.

Can someone else try this please as I want to confirm that it may be a bug, not just a "Me and my machine" problem please ?
I'm on KUbuntu with Gambas 3.10.90

Cheers - Quin.
I code therefore I am
Online now: No Back to the top

Post

Posted
Rating:
#2
Avatar
Guru
cogier is in the usergroup ‘Guru’
Hi Quin,

I think the line you are looking for is

Code (gambas)

  1. PictureBox1.Picture = Null

I created this, hope it helps.
Attachment
Online now: No Back to the top

Post

Posted
Rating:
#3
Avatar
Regular
jornmo is in the usergroup ‘Regular’
I think he is asking us to test his code, and report weather its working or not cogier. I am unable to try it for the moment, as Gambas will not start due to some recent QT upgrade that seems to break it.

Online now: No Back to the top

Post

Posted
Rating:
#4
Avatar
Guru
cogier is in the usergroup ‘Guru’
Even though the help files say that the '.Picture.Clear' clears the picture. I can not get the picture to clear using Quin's code.
Online now: No Back to the top

Post

Posted
Rating:
#5
Avatar
Regular
jornmo is in the usergroup ‘Regular’
 So, it's a bug, or even worse, a poorly documented feature…

Online now: No Back to the top

Post

Posted
Rating:
#6
Avatar
Expert
Quincunxian is in the usergroup ‘Expert’
 Thanks Jornmo & Cogier,
I did try setting to Null too and that did not work either so I guess that it's a bug.
I'll post of the Gambas forum and see what happens and let you know.

Cheers - Quin.
I code therefore I am
Online now: No Back to the top

Post

Posted
Rating:
#7
Avatar
Guru
cogier is in the usergroup ‘Guru’
I have loaded Kubuntu 17.10, added the Gambas ppa for Gambas 3.10.0 (stable) then run my program and it works just fine. Have a look at the video I created here http://www.cogier.com/test/.
Online now: No Back to the top
1 guest and 0 members have just viewed this.