Page 1 of 1

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

Posted: Thursday 21st May 2020 4:58pm
by DavideTr
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

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

Posted: Thursday 21st May 2020 6:07pm
by cogier
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.
Picts-0.0.1.tar.gz
(705.58 KiB) Downloaded 3 times

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

Posted: Thursday 21st May 2020 7:22pm
by DavideTr
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: Select all

 PictureBoxName.Picture = Picture.Load("Hours_CircleProgress/Hours_CircleProgress_" & 1 & ".png")