Windows Mobile/Directdraw:旋转视频流 [英] Windows Mobile / Directdraw: Rotate video stream

查看:133
本文介绍了Windows Mobile/Directdraw:旋转视频流的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

后续操作: Directdraw:旋转视频流

我设法预览了摄像机的视频流,但是图像旋转了90°进入横向模式.我现在正在寻找一种将摄像机图像旋转回正常状态的方法,但是问题是我什至不知道从哪里开始:这是在DDSURFACEDESC结构的VideoCaptureFilter,VideoInfoHeader中完成的吗?只能通过使用其他过滤器来完成旋转吗?是过滤器设置吗?

I managed to preview the camera's video stream, but the image is rotated by 90° to landscape mode. I'm now searching for a way to rotate the camera image back to normal, but the problem is I don't even know where to start: Is this done in the VideoCaptureFilter, the VideoInfoHeader, in a DDSURFACEDESC structure? Can the rotation only be done by using an additional filter? Is it a filter setting?

推荐答案

我发现通常使用BI_SRCPREROTATE标志来完成此操作:

I found out that this is usually done with the BI_SRCPREROTATE flag:

开发了一个特殊的标志 (BI_SRCPREROTATE)告诉GDI和 视频渲染器 图像的方向 相机的方向正确 (渲染时请勿旋转).这 这是必要的,因为随着您旋转 外壳上的设备,你也 物理旋转设备.当...的时候 显示驱动程序将位图旋转到 渲染所需的外壳和UI 知道这个特定的位图 不应该旋转.该标志是或 进入 BITMAPINFO结构.

A special flag was developed (BI_SRCPREROTATE) which tells GDI and the video renderer that the orientation of the image from the camera is in the correct orientation (don't rotate when rendering it). This is necessary because as you rotate the shell on the device you also physically rotate the device. When the display driver rotates bitmaps to render the shell and UI it needs to know that this particular bitmap shouldn't be rotated. The flag is or'd into the biCompression field in the BITMAPINFO structure.

来自 http://www.tech-archive.net/Archive/PocketPC/microsoft.public.pocketpc.developer/2005-12/msg00850.html

示例代码如下:

  pVih->bmiHeader.biCompression &= ~BI_SRCPREROTATE;

来自 http://innovator.samsungmobile.com/bbs/discussion/view.do?parentCategoryId=4&messageId=45549&boardId=224&platformId=2

但是此方法不适用于我使用的HTC HD2,但可能与其他设备一起使用,因此我决定将其添加到我的问题中.

This method however is not working with the HTC HD2 I am using, but it might work with other devices, so I decided to add this to my question.

这篇关于Windows Mobile/Directdraw:旋转视频流的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆