You are on page 1of 27

C#

Multimedia
VERA A. PANAGUITON
Two Types of File Resources
In Local resource, the file can
be used only with that
particular form and if you
need it in some other form
you have to duplicate it.

In Project resource, the file


could be used across multiple
forms and no file duplication.

APDEV by Vera A. Panaguiton 2


IMAGES
Drag a PictureBox control
from the toolbox
Click the …

APDEV by Vera A. Panaguiton 4


Click Import and select the image.
APDEV by Vera A. Panaguiton 5
Images will be saved in the
Resources

APDEV by Vera A. Panaguiton 6


If you want to resize the image, choose
StretchImage for SizeMode property

APDEV by Vera A. Panaguiton 7


You can also create logo, icons, etc. for
background images for buttons.

APDEV by Vera A. Panaguiton 8


Buttons PictureBox Use pictureBox so that you can have
a BorderStyle property.

APDEV by Vera A. Panaguiton 9


AUDIO
To specify
method
name, just
type in the
Click event.

Code for the click method will


be automatically added.
Add first the Library if you
want to add audio in your
forms.
Instantiate the
SoundPlayer and
add the path of
your audio file.

Code for
button play

Code for
button stop
Add Resources

To add files just select


Properties then click
Resources.resx, then click
ENTER
Select Audio
Click Add Resource then
choose your audio File

File added in the


Resources Folder.
Select your audio file and change the
Persistence Property to Embedded in .resx
Play audio from Resources
Change the code for the file location.

sound1 is the
filename of your
audio file
VIDEOS
To add windows media
player. Right click
BindingSource then
select Choose items…
Select COM Components
and check Windows Media
Player
Drag Windows Media
Player from Toolbox
Resize then change the
Name property.
Double Click the form to go to code if
you don’t have any buttons for events.

Event for form Load will be


automatically added.

Code for the video player


- END -

APDEV by Vera A. Panaguiton 27

You might also like