想请微软专家回答,MediaPlayer的问题!

roc_fu 2002-10-03 11:50:08
我用截取MediaPlayer显示区的方法截取图像,可以另存为文件,但是图像质量太差如果将WindowlessVideo属性设成法FALSE后播放器中质量可以,但又无法截图了,截到的图像都是黑乎乎的,请问各位高手有没有好的办法?或者MediaPlayer有自己的方法截图?,另外,怎么才能知道打开的视频文件的格式,比如是NTSC还是PAL的?
这个问题好像为人能解决,我看这里解答问题的微软专家比较多,所以就来了
...全文
82 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
Sean918 2002-10-31
  • 打赏
  • 举报
回复
给你一个函数,看懂了就行

#If Win32 Then

Public Function CaptureWindow(ByVal hWndSrc As Long, _
ByVal Client As Boolean, ByVal LeftSrc As Long, _
ByVal TopSrc As Long, ByVal WidthSrc As Long, _
ByVal HeightSrc As Long) As Picture

Dim hDCMemory As Long

Dim hBmp As Long

Dim hBmpPrev As Long

Dim r As Long

Dim hDCSrc As Long

Dim hPal As Long

Dim hPalPrev As Long

Dim RasterCapsScrn As Long

Dim HasPaletteScrn As Long

Dim PaletteSizeScrn As Long

#ElseIf Win16 Then

Public Function CaptureWindow(ByVal hWndSrc As Integer, _
ByVal Client As Boolean, ByVal LeftSrc As Integer, _
ByVal TopSrc As Integer, ByVal WidthSrc As Long, _
ByVal HeightSrc As Long) As Picture

Dim hDCMemory As Integer

Dim hBmp As Integer

Dim hBmpPrev As Integer

Dim r As Integer

Dim hDCSrc As Integer

Dim hPal As Integer

Dim hPalPrev As Integer

Dim RasterCapsScrn As Integer

Dim HasPaletteScrn As Integer

Dim PaletteSizeScrn As Integer

#End If

Dim LogPal As LOGPALETTE

' Depending on the value of Client get the proper device context

If Client Then

hDCSrc = GetDC(hWndSrc) ' Get device context for Client area

Else

hDCSrc = GetWindowDC(hWndSrc) ' Get device context for entire window

End If

' Create a memory device context for the copy process

hDCMemory = CreateCompatibleDC(hDCSrc)

' Create a bitmap and place it in the memory DC

hBmp = CreateCompatibleBitmap(hDCSrc, WidthSrc, HeightSrc)

hBmpPrev = SelectObject(hDCMemory, hBmp)

' Get screen properties

RasterCapsScrn = GetDeviceCaps(hDCSrc, RASTERCAPS) 'Raster capabilities

HasPaletteScrn = RasterCapsScrn And RC_PALETTE 'Palette support

PaletteSizeScrn = GetDeviceCaps(hDCSrc, SIZEPALETTE) 'Size of palette

' If the screen has a palette make a copy and realize it

If HasPaletteScrn And (PaletteSizeScrn = 256) Then

' Create a copy of the system palette

LogPal.palVersion = &H300

LogPal.palNumEntries = 256

r = GetSystemPaletteEntries(hDCSrc, 0, 256, LogPal.palPalEntry(0))

hPal = CreatePalette(LogPal)

' Select the new palette into the memory DC and realize it

hPalPrev = SelectPalette(hDCMemory, hPal, 0)

r = RealizePalette(hDCMemory)

End If

' Copy the on-screen image into the memory DC

r = BitBlt(hDCMemory, 0, 0, WidthSrc, HeightSrc, hDCSrc, _
LeftSrc, TopSrc, vbSrcCopy)

' Remove the new copy of the the on-screen image

hBmp = SelectObject(hDCMemory, hBmpPrev)

' If the screen has a palette get back the palette that was selected

' in previously

If HasPaletteScrn And (PaletteSizeScrn = 256) Then

hPal = SelectPalette(hDCMemory, hPalPrev, 0)

End If

' Release the device context resources back to the system

r = DeleteDC(hDCMemory)

r = ReleaseDC(hWndSrc, hDCSrc)

' Call CreateBitmapPicture to create a picture object from the bitmap

' and palette handles. Then return the resulting picture object.

Set CaptureWindow = CreateBitmapPicture(hBmp, hPal)

End Function
88480 2002-10-22
  • 打赏
  • 举报
回复
不能用
eithur 2002-10-03
  • 打赏
  • 举报
回复
你看看你的MediaPlayer(我指windows自带的播放器程序),有截图功能吗?
当然,没有,如果该控件有这种方法,那么MSDN应该说了。所以,你不用在控件上想办法了。
不过在C里面可以。呵呵
shortppsy 2002-10-03
  • 打赏
  • 举报
回复
用其他的工具吧~
roc_fu 2002-10-03
  • 打赏
  • 举报
回复
eithur(阿恺) 在C里有,你就说出来啊。
huangjw 2002-10-03
  • 打赏
  • 举报
回复
MediaPlayer好象不能截图,如果能的话请赐教.
内容概要:本文系统研究了构网型变流器的正负序阻抗解耦特性及其在弱电网环境下的稳定性表现,重点依托Matlab/Simulink仿真平台,构建了详细的阻抗数学模型,设计了解耦控制策略,并采用小信号扫频法进行频域辨识与稳定性验证。研究深入探讨了构网型变流器与传统跟网型逆变器在正负序阻抗特性上的本质差异,结合虚拟同步发电机(VSG)等先进控制技术,分析其在抑制宽频带振荡、削弱锁相环动态耦合等方面的优越性。文中不仅提供了完整的仿真模型与MATLAB代码实现,还整合了光伏、风电、储能、微电网等多类新能源系统的阻抗建模与稳定性分析资源,形成了一套面向新型电力系统稳定性的综合性技术资料体系,具有较强的科研复现与工程参考价值。; 适合人群:面向具备电力电子、电力系统自动化、新能源并网等专业背景的研究生、高校教师及工程技术人员,特别适用于从事阻抗建模、小干扰稳定性分析、宽频振荡机理研究以及撰写高水平学术论文的科研工作者。; 使用场景及目标:①掌握构网型变流器正负序阻抗建模与扫频辨识的仿真方法;②深入理解VSG等构网型控制在弱电网中提升稳定性的内在机理;③复现顶刊论文中的阻抗分析流程与稳定性判据应用;④利用提供的成熟模型与代码加速科研进程,支撑课题研究与学术成果产出。; 阅读建议:建议结合文中提供的Simulink模型与MATLAB代码,按照“理论建模—仿真搭建—扫频激励—频响提取—Nyquist判据分析”的完整流程进行实践操作,重点关注扫频信号的注入方式、频率范围设置及阻抗曲线的物理意义解读,并参考博士论文复现案例深化对复杂动态耦合问题的理解。

7,787

社区成员

发帖
与我相关
我的任务
社区描述
VB 基础类
社区管理员
  • VB基础类社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧