2015-09-04 89 views
0

我正在使用Skype4ComLib庫嘗試向Skype上的聯繫人發送圖像。如何通過Skype API發送圖像?

Private Sub Button17_Click(sender As Object, e As EventArgs) Handles btnImageLoad.Click 
    OpenFileDialog1.ShowDialog() 
    PicBox.ImageLocation = OpenFileDialog1.FileName.ToString 
End Sub 

這會打開一個對話框供用戶選擇圖像並將其加載到名爲PicBox的圖片框中。

Private Sub Button15_Click(sender As Object, e As EventArgs) Handles Button15.Click 
    TimerImage.Stop() 
End Sub 

Private Sub Button15_Click(sender As Object, e As EventArgs) Handles Button16.Click 
    TimerImage.Stop() 
End Sub 

按鈕15和16啓動計時器。

我想從定時器內發送圖像,但我不能使用skype.sendmessage,因爲它只接受字符串。

任何想法?

回答

0

使用SendKeys.Send方法,您可以通過實際的Skype應用程序將剪貼板中的圖片粘貼到消息中。

這是我要做的事:

My.Computer.Clipboard.SetImage(PicBox.Image) 
SkypeClient.Client.OpenMessageDialog("<contact to send to>") 
SkypeClient.Client.Focus() 
SendKeys.Send("^(V){ENTER}") 

替換<contact to send to>你想要將圖片發送給聯繫人的姓名。