微软的一项Agent技术(动画小精灵)

微软的一项Agent技术(动画小精灵) Agent 技术,通过运行该技术就可以在自己的程序中使用很有趣的精灵了。 Microsoft Agent核心组建 Microsoft Agent的四个精灵:吉尼(Genie)、么林(Merlin)、罗比(Robby)以及皮蒂(Peedy) //在创建程序的用户界面以前我们必须先导入Agent Control这个ActiveX控件,该控件在你安装好系统要求中的项后便有了。下面是导入的方法:选择菜单"工具->自定义工具箱",并选择Microsoft Agent Control 2.0组件// (vb.net中可能无需此步) Private agentController As AgentObjects.Agent Private agentCharacter As AgentObjects.IAgentCtlCharacter private IAgentCtlCharacterEx Character;(这就是我们要用到的精灵的对象)。 Private Sub frmMain_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load ' The Agent object is used to open a connection to the Agent server, ' load the character, and then associate the character with the ' variable referencing the IAgentCtlCharacter interface. From then ' on you program against the agentCharacter. agentController = New AgentObjects.Agent() With agentController .Connected = True .Characters.Load("merlin", "merlin.acs") /导入精灵么林(Merlin) agentCharacter = .Characters("merlin") End With ' 使用位置属性将精灵放置在窗体的左上角. With agentCharacter .MoveTo(CShort(Me.Location.X + 420), CShort(Me.Location.Y + 130)) .Show() .Play("Announce") // Announce 是精灵的一种行为“吹喇叭” .Speak("Hello, my name is Merlin. " & _ "Welcome to the Office Automation Demo!") .Play("GestureRight") // GestureRight是精灵的一种行为“请” .Play("wave") // GestureRight是精灵的一种行为“招手” 'You can make Merlin's speech sound more natural by inserting speech ' output tags like Pau (Pause), Chr (Character of the Voice), ' Emp (Emphasis) or Spd (Speed). Surround each name-value pair with a ' backslash character. .Speak("Make me say something,/pau=300/or/pau=500/...") .MoveTo(CShort(Me.Location.X + 340), CShort(Me.Location.Y + 250)) .Play("GestureRight") .Speak("...try out some of my animations.") End With End Sub
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值