MFC视频窗口中想画一个十字 怎么实现
MFC视频窗口中想画一个十字 如何实现
有两个想法,一种是让自己更好熟悉画线,想在已经成像的窗口上画一个十字;
一种是在成像的窗口上确定的坐标显示一个十字用于标记用。
谢谢各位,如果能具体些(当我是个啥都不懂的。。)那就更好了 。。。。
PS:我就是刚开始接触,如果问题问得不清楚我再补充,如果问得很2 很低端,麻烦谅解下!
------解决思路----------------------
视频窗口如果是用DC的RGB显示可以使用内存DC先加载视频 再画线
如果是使用D3D显示就比较麻烦
------解决思路----------------------
在你程序的窗口中画十字?
动态画十字的作法之一,建立一个可供调用的函数,入口参数应该是个“点”-(CPoint类型)。函数内部可根据这个点的坐标和DC进行画线,写函数时全部要使用相对坐标。
------解决思路----------------------
Overlay Z-Orders
Overlay surfaces are assumed to be on top of all other screen components, but when you display multiple overlay surfaces, you need some way to visually organize them. DirectDraw supports overlay z-ordering to manage the order in which overlays clip each other. Z-order values represent conceptual distances from the primary surface toward the viewer. They range from 0, which is just on top of the primary surface, to 4 billion, which is as close to the viewer as possible, and no two overlays can share the same z-order. You set z-order values by calling the IDirectDrawSurface3::UpdateOverlayZOrder method.
Destination color keys are affected only by the bits on the primary surface, not by overlays occluded by other overlays. Source color keys work on an overlay whether or not a z-order was specified for the overlay.
Overlays without a specified z-order are assumed to have a z-order of 0. Overlays that do not have a specified z-order behave in unpredictable ways when overlaying the same area on the primary surface.
A DirectDraw object does not track the z-orders of overlays displayed by other applications.
------解决思路----------------------
两种方法:
1. 在你渲染视频每一帧时,将十字画到帧中,然后在进行渲染。
万万不可直接用GDI在视频窗口上画,那么画上也没用,会被后续的视频帧给覆盖掉,
或者你可以再渲染后,在用GDI画,但是这样会出现闪烁现象。
2. 在你视频窗口上,蒙一层透明窗口,在这个透明窗口上画十字。
------解决思路----------------------
首先你要获得到视频的每一帧,然后对这一帧图像做画线处理,然后再显示在界面上,可以用OpenCV+Directshow来做
------解决思路----------------------
把 鼠标样式改成十字星
有两个想法,一种是让自己更好熟悉画线,想在已经成像的窗口上画一个十字;
一种是在成像的窗口上确定的坐标显示一个十字用于标记用。
谢谢各位,如果能具体些(当我是个啥都不懂的。。)那就更好了 。。。。
PS:我就是刚开始接触,如果问题问得不清楚我再补充,如果问得很2 很低端,麻烦谅解下!
------解决思路----------------------
视频窗口如果是用DC的RGB显示可以使用内存DC先加载视频 再画线
如果是使用D3D显示就比较麻烦
------解决思路----------------------
在你程序的窗口中画十字?
动态画十字的作法之一,建立一个可供调用的函数,入口参数应该是个“点”-(CPoint类型)。函数内部可根据这个点的坐标和DC进行画线,写函数时全部要使用相对坐标。
------解决思路----------------------
Overlay Z-Orders
Overlay surfaces are assumed to be on top of all other screen components, but when you display multiple overlay surfaces, you need some way to visually organize them. DirectDraw supports overlay z-ordering to manage the order in which overlays clip each other. Z-order values represent conceptual distances from the primary surface toward the viewer. They range from 0, which is just on top of the primary surface, to 4 billion, which is as close to the viewer as possible, and no two overlays can share the same z-order. You set z-order values by calling the IDirectDrawSurface3::UpdateOverlayZOrder method.
Destination color keys are affected only by the bits on the primary surface, not by overlays occluded by other overlays. Source color keys work on an overlay whether or not a z-order was specified for the overlay.
Overlays without a specified z-order are assumed to have a z-order of 0. Overlays that do not have a specified z-order behave in unpredictable ways when overlaying the same area on the primary surface.
A DirectDraw object does not track the z-orders of overlays displayed by other applications.
------解决思路----------------------
两种方法:
1. 在你渲染视频每一帧时,将十字画到帧中,然后在进行渲染。
万万不可直接用GDI在视频窗口上画,那么画上也没用,会被后续的视频帧给覆盖掉,
或者你可以再渲染后,在用GDI画,但是这样会出现闪烁现象。
2. 在你视频窗口上,蒙一层透明窗口,在这个透明窗口上画十字。
------解决思路----------------------
首先你要获得到视频的每一帧,然后对这一帧图像做画线处理,然后再显示在界面上,可以用OpenCV+Directshow来做
------解决思路----------------------
把 鼠标样式改成十字星