Import multimedia files (.png, .mp3) into the project

Post

Posted
Rating:
#1 (In Topic #417)
Avatar
Trainee
Hi everyone, on Visual Studio from the project properties page I had the possibility to import different types of files which are then incorporated into the executable after compilation. I can recall these files from the script to load a ".png" image into a PictureBox or reproduce sounds etc.

My questions are as follows:
1). How can I do this same operation in Gambas 3, so that these files are incorporated into my compiled application?
2). How can I load a ".png" located inside my project into a PictureBox?

Thank you all :D
Online now: No Back to the top

Post

Posted
Rating:
#2
Avatar
Guru
cogier is in the usergroup ‘Guru’
 How can I do this same operation in Gambas 3, so that these files are incorporated into my compiled application?
Place the files you want in the application's folder (From the menu Tools > Browse project..)

How can I load a ".png" located inside my project into a PictureBox?
You can add it in the IDE through the PictureBox property Picture or if the picture is in the application folder: -

PictureBox1.Picture = Picture["MyPict.png"]

See the 'no code used' example attached.
Attachment
Online now: No Back to the top

Post

Posted
Rating:
#3
Avatar
Trainee
Thanks for the information, after inserting the various files into the project, by doing some tests I understood that to load an image I just need to use:

Code

 PictureBoxName.Picture = Picture.Load("Hours_CircleProgress/Hours_CircleProgress_" & 1 & ".png")
Online now: No Back to the top
1 guest and 0 members have just viewed this.