Exemplo n.º 1
0
 private void PlayBackMouseMove(object sender, MouseEventArgs e)
 {
     if (CurVideo.CameraType == 4)
     {
         if (!m_bEagleMoved)
         {
             return;
         }
         //int tag = Convert.ToInt32(EaglePalyBackVideo.Tag);
         float fpi                   = 3.1415926f;
         int   iWndWidth             = EaglePalyBackVideo.PicWidth;  //当前窗口宽度
         int   iWndHeight            = EaglePalyBackVideo.PicHeight; //当前窗口高度
         PlayCtrl.DRAWPOINT strPoint = new PlayCtrl.DRAWPOINT();
         strPoint.x = e.X * 1.0f / iWndWidth;
         strPoint.y = e.Y * 1.0f / iWndHeight;
         strPoint.x = ((e.X - m_strPlayBackPoint.x) * 1.0f) / iWndWidth;
         strPoint.y = ((e.Y - m_strPlayBackPoint.y) * 1.0f) / iWndHeight;
         PlayCtrl.PLAYM4SRTRANSFERPARAM   stParam    = new PlayCtrl.PLAYM4SRTRANSFERPARAM();
         PlayCtrl.PLAYM4SRTRANSFERELEMENT stSubParam = new PlayCtrl.PLAYM4SRTRANSFERELEMENT();
         stSubParam.fAxisX = strPoint.x * 8 * fpi;
         stSubParam.fAxisY = strPoint.y * 4 * fpi;
         stSubParam.fAxisZ = 0.0f;
         stSubParam.fValue = 0.0f;
         IntPtr ptrSRTransformElement = Marshal.AllocHGlobal(Marshal.SizeOf(stSubParam));
         Marshal.StructureToPtr(stSubParam, ptrSRTransformElement, false);
         stParam.pTransformElement = ptrSRTransformElement;
         bool isRotate = PlayCtrl.PlayM4_SR_Rotate(m_PlayBackPort, ref stParam);
         //uint errorcode= PlayCtrl.PlayM4_GetLastError(m_PlayBackPort);
         m_strPlayBackPoint.x = e.X;
         m_strPlayBackPoint.y = e.Y;
         Marshal.FreeHGlobal(ptrSRTransformElement);
     }
 }