使用ResampleMedia重新采样并重置分辨率

上传人:jiups****uk12 文档编号:38420576 上传时间:2018-05-01 格式:DOCX 页数:3 大小:26.43KB
返回 下载 相关 举报
使用ResampleMedia重新采样并重置分辨率_第1页
第1页 / 共3页
使用ResampleMedia重新采样并重置分辨率_第2页
第2页 / 共3页
使用ResampleMedia重新采样并重置分辨率_第3页
第3页 / 共3页
亲,该文档总共3页,全部预览完了,如果喜欢就下载吧!
资源描述

《使用ResampleMedia重新采样并重置分辨率》由会员分享,可在线阅读,更多相关《使用ResampleMedia重新采样并重置分辨率(3页珍藏版)》请在金锄头文库上搜索。

1、 e800,国内最具活力的 IT 门户网站。http:/ 【e800 编译】此示例演示在 Microsoft PowerPoint 2010 演示文稿中如何重新取样以及 重新设置视频的分辨率。 此代码段是 Office 2010 的 101 项 VBA 代码示例中的一部分。与其它示例一样,这些将 可以直接写入您的代码中。 每块示例代码包含约 5 至 50 行的代码,分别演示了一个独特的功能或功能集,在 VBA 或 VB 以及 C中(在 Visual Studio 2010 中创建) 。每个示例之中都会包含代码以及相应注 释,这样您就可以直接运行获取预期的结果,或者是根据代码注释提示来调整环境,

2、运行 示例代码。 Microsoft Office 2010 提供了你所需要的工具来创建功能强大的应用程序。Microsoft Visual Basic Application(VBA)代码示例可以帮助你创建自己的应用程序,以执行特定功能 或者以此为出发点实现更为复杂的功能。 实例代码 将此代码复制到在新演示文稿的一个模块。在第一张幻灯片里添加视频(在“插入” 选项卡中选择“视频” ,找到视频目录) 。播放视频,确保一切正常,然后将光标放置在下 面进程中,单步执行代码。SubSub ResampleDemo() This code works through every shape on th

3、e first slide in the presentation, and for each video it finds, resamples the video to 240x320. If the resampling succeeds, the code resizes the video shape to match the new resolution.DimDim shp AsAs ShapeForFor EachEach shp InIn ActivePresentation.Slides(1).Shapes Is it a media shape?IfIf shp.Type

4、 = msoMedia ThenThenDebug.Print “Media Element: “ & shp.NameDimDim newWidth AsAs IntegerIntegerDimDim newHeight AsAs IntegerIntegernewHeight = 240newWidth = 320e800,国内最具活力的 IT 门户网站。http:/ You can specify other parameters, as well, indicating the video frame rate, the audio sampling rate, and the vid

5、eo bit rate. For now, just resample and reset the resolution-the lower the resolution, the smaller the video content.shp.MediaFormat.Resample TrueTrue, newHeight, newWidthDoDoDoEventsPause 1Debug.Print “Resample status: “ & shp.MediaFormat.ResamplingStatusLoopLoop WhileWhile shp.MediaFormat.Resampli

6、ngStatus = ppMediaTaskStatusInProgressDebug.Print “Resample status: “ & shp.MediaFormat.ResamplingStatusIfIf shp.MediaFormat.ResamplingStatus = ppMediaTaskStatusDone ThenThenshp.Width = newWidthshp.Height = newHeightEndEnd IfIfEndEnd IfIfNextNext shpEndEnd SubSubFunctionFunction Pause(numberOfSeconds AsAs VariantVariant)DimDim startTime, endTime AsAs VariantVariantstartTime = TimerendTime = startTime + numberOfSecondse800,国内最具活力的 IT 门户网站。http:/ DoDo WhileWhile Timer endTimeDoEventsLoopLoopEndEnd FunctionFunction

展开阅读全文
相关资源
正为您匹配相似的精品文档
相关搜索

最新文档


当前位置:首页 > 行业资料 > 其它行业文档

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号