- 4
- 0
- 约1.7千字
- 约 3页
- 2017-07-28 发布于浙江
- 举报
使用ResampleMedia重新采样并重置分辨率
【e800编译】此示例演示在Microsoft PowerPoint 2010演示文稿中如何重新取样以及重新设置视频的分辨率。此代码段是Office 2010的101项VBA代码示例中的一部分。与其它示例一样,这些将可以直接写入您的代码中。每块示例代码包含约5至50行的代码,分别演示了一个独特的功能或功能集,在VBA或VB以及C#中(在Visual Studio 2010中创建)。每个示例之中都会包含代码以及相应注释,这样您就可以直接运行获取预期的结果,或者是根据代码注释提示来调整环境,运行示例代码。Microsoft Office 2010提供了你所需要的工具来创建功能强大的应用程序。Microsoft Visual Basic Application(VBA)代码示例可以帮助你创建自己的应用程序,以执行特定功能或者以此为出发点实现更为复杂的功能。实例代码将此代码复制到在新演示文稿的一个模块。在第一张幻灯片里添加视频(在“插入”选项卡中选择“视频”,找到视频目录)。播放视频,确保一切正常,然后将光标放置在下面进程中,单步执行代码。SubResampleDemo() This code works through every shape on the 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.DimshpAsShapeForEachshpInActivePresentation.Slides(1).Shapes Is it a media shape?Ifshp.Type=msoMediaThenDebug.PrintMedia Element: shp.NameDimnewWidthAsIntegerDimnewHeightAsIntegernewHeight=240newWidth=320 You can specify other parameters, as well, indicating the video frame rate, the audio sampling rate, and the video bit rate. For now, just resample and reset the resolution--the lower the resolution, the smaller the video content.shp.MediaFormat.ResampleTrue,newHeight,newWidthDoDoEventsPause1Debug.PrintResample status: shp.MediaFormat.ResamplingStatusLoopWhileshp.MediaFormat.ResamplingStatus=ppMediaTaskStatusInProgressDebug.PrintResample status: shp.MediaFormat.ResamplingStatusIfshp.MediaFormat.ResamplingStatus=ppMediaTaskStatusDoneThenshp.Width=newWidthshp.Height=newHeightEndIfEndIfNextshpEndSubFunctionPause(numberOfSecondsAsVariant)DimstartTime,endTimeAsVariantstartTime=TimerendTime=startTime+numberOfSecondsDoWhileTimerendTimeDoEventsLoopEndFunction
您可能关注的文档
- 数据结构实验-系数矩阵.docx
- Cigwa6415伏安谐波分析仪.doc
- cp复制文件的UNIX命令.docx
- AAA数控设备维修实例.doc
- C语言小数的内存表示.doc
- c语言值传递的3种形式.docx
- c50砼施工技术.doc
- C语言编写的五子棋源代码.docx
- CVT(无级变速).doc
- CR快捷键.txt.docx
- 全过程工程管理造价咨询工程监理项目服务方案投标方案(技术部分).doc
- 招标代理服务投标技术服务方案(技术方案).doc
- AI大模型与AIGC技术在公安领域的应用解决方案(99页 PPT).pptx
- 工业4.0智能制造数字工厂规划方案.pptx
- 树立社会主义核心价值观.docx
- 三年(2023-2025)中考历史真题分类汇编(全国)专题21 科技文化与社会生活(解析版).docx
- 2025年中考道德与法治真题完全解读(吉林卷).pdf
- 2025年中考道德与法治真题完全解读(安徽卷).pdf
- 三年(2023-2025)中考历史真题分类汇编(全国)专题14 人民解放战争(解析版).pdf
- 三年(2023-2025)广东中考历史真题分类汇编:专题03 中国近代史(八年级上册)(解析版).docx
最近下载
- 500t吊车性能表(中文版).pdf VIP
- 人教版八年级上历史知识点总结 .doc VIP
- 米莉的帽子变变变精品解析.ppt VIP
- 职业教育人工智能应用发展报告(2024-2025).pptx VIP
- 2025年高等教育医学类自考-03037药用植物学考试近5年真题集锦(频考类试题)带答案.docx VIP
- TCAQ10201-2024质量管理小组活动准则_可搜索.pdf VIP
- 确定肿瘤的重要基因信息——提取基因图谱信息方法的研究.pdf VIP
- 事业单位嫖娼违法写检讨书.docx VIP
- 人教版物理8年级下册全册教学课件.pptx
- 第二十五章+图形的相似(复习课件)数学冀教版九年级上册.pptx VIP
原创力文档

文档评论(0)