2015-09-04 88 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>你想要将图片发送给联系人的姓名。