This post has been edited 3 times, last edit by "OlimilO" (Mar 11th 2009, 5:28pm)
Jabaco Source |
|
1 |
Picture1.Picture = Resources.MyPicPng |
This post has been edited 5 times, last edit by "OlimilO" (Mar 11th 2009, 5:25pm)
This post has been edited 1 times, last edit by "OlimilO" (Mar 11th 2009, 4:59pm)
Jabaco Source |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
Private m_Wave() As Byte Private Declare Function PlaySound Lib "winmm.dll" Alias "PlaySoundA" ( _ ByRef lpSound As Byte, ByVal hModule As Long, ByVal dwFlags As Long) As Long Private Const SND_MEMORY As Long = &H4 Private Sub Form_Load() 'Function LoadResData(id, type) ' Mitglied von VB.Global ' Lädt Daten von verschiedenen möglichen Typen aus einer ' Ressourcendatei (.RES) und gibt ein Byte-Array zurück. 'Type: "WAVE", id: 101 m_Wave = LoadResData(101, "WAVE") End Sub Private Sub Command1_Click() PlaySound m_Wave(0), 0, SND_MEMORY End Sub |
Jabaco Source |
|
1 2 3 |
Public Function LoadResData(resID As IResource) As InputStream Set LoadResData = getClass.getResourceAsStream(resID) End Function |
Jabaco Source |
|
1 2 3 4 |
Public Function GetWavResClip(ResID As IResource) As Clip GetWavResClip = AudioSystem.getClip GetWavResClip.open(AudioSystem.getAudioInputStream(LoadResData(ResID))) End Function |
Jabaco Source |
|
1 2 3 4 5 6 |
Private Sub Command1_Click() Dim clip1 As Clip = GetWavResClip(Resources.ChimesWav) Dim clip2 As Clip = GetWavResClip(Resources.TadaWav) clip1.start clip2.start End Sub |
This post has been edited 1 times, last edit by "OlimilO" (Mar 15th 2009, 9:32pm)
Jabaco Source |
|
1 2 3 4 5 6 7 8 9 10 |
Public Function LoadResData(resID As IResource) As InputStream Set LoadResData = Nothing Set LoadResData = getClass.getResourceAsStream(resID) End Function Public Function GetWavResClip(ResID As IResource) As Clip Set GetWavResClip = Nothing GetWavResClip = AudioSystem.getClip GetWavResClip.open(AudioSystem.getAudioInputStream(LoadResData(ResID))) End Function |
This post has been edited 1 times, last edit by "JasonS" (Oct 27th 2011, 11:15pm)