Ejemplo n.º 1
0
        private IntPtr GetHBitmapCore(double position)
        {
            MFrame mFrame = null;

            _mfileObj.FileFrameGet(position, 0.0, out mFrame);
            M_AV_PROPS m_AV_PROPS = default(M_AV_PROPS);

            mFrame.FrameAVPropsGet(out m_AV_PROPS);

            m_AV_PROPS.vidProps.nWidth    = m_AV_PROPS.vidProps.nWidth / 5;
            m_AV_PROPS.vidProps.nHeight   = m_AV_PROPS.vidProps.nHeight / 5;
            m_AV_PROPS.vidProps.nRowBytes = m_AV_PROPS.vidProps.nRowBytes / 5;
            MFrame mFrame2 = null;

            mFrame.FrameConvert(ref m_AV_PROPS.vidProps, out mFrame2, string.Empty);
            long value = 0L;

            mFrame2.FrameVideoGetHbitmap(out value);

            Marshal.ReleaseComObject(mFrame);
            Marshal.ReleaseComObject(mFrame2);
            mFrame2 = null;
            mFrame  = null;

            return(new System.IntPtr(value));
        }
Ejemplo n.º 2
0
        private IntPtr GetHBitmapInternal(string filePath, double position)
        {
            IntPtr hBitmap = IntPtr.Zero;

            if (_mfileObj != null)
            {
                try
                {
                    _mfileObj.FileNameSet(filePath, string.Empty);
                    _mfileObj.ObjectStart(null);

                    try
                    {
                        MFrame mFrame = null;
                        _mfileObj.FileFrameGet(position, 0.0, out mFrame);
                        long value = 0L;
                        mFrame.FrameVideoGetHbitmap(out value);

                        Marshal.ReleaseComObject(mFrame);
                        mFrame  = null;
                        hBitmap = new System.IntPtr(value);
                    }
                    finally
                    {
                        _mfileObj.ObjectClose();
                    }
                }
                catch
                {
                    hBitmap = IntPtr.Zero;
                }
            }
            return(hBitmap);
        }
Ejemplo n.º 3
0
 private void M_objMFile4_OnFrameSafe(string bsChannelID, object pMFrame)
 {
     if (count3 % interval == 0)
     {
         MFrame frame = pMFrame as MFrame;
         m_objPreview3.ReceiverPutFrame("", pMFrame as MFrame);
     }
     Marshal.ReleaseComObject(pMFrame);
     count3++;
 }
Ejemplo n.º 4
0
        private IntPtr GetHBitmapCore2(double position)
        {
            MFrame mFrame = null;

            _mfileObj.FileFrameGet(position, 0.0, out mFrame);
            long value = 0L;

            mFrame.FrameVideoGetHbitmap(out value);

            Marshal.ReleaseComObject(mFrame);
            mFrame = null;
            return(new System.IntPtr(value));
        }
 public void setHolder(MTimeLineHoder mTimeLineHoderT)
 {
     currentTimeLineHoder = mTimeLineHoderT;
     currentTimeLine = null;
     focusFrame = null;
     if (currentTimeLineHoder != null && timePosition >= currentTimeLineHoder.getMaxFrameLen())
     {
         timePosition = currentTimeLineHoder.getMaxFrameLen() - 1;
     }
     if (timePosition<0)
     {
         timePosition = 0;
     }
     clearFrameFocus();
     form_MA.form_MFrameEdit.releaseFocusClips();
 }
Ejemplo n.º 6
0
        private IntPtr GetMediaFileInfoInternal(string filePath, out double dblDuration)
        {
            IntPtr hBitmap = IntPtr.Zero;

            dblDuration = 0;
            if (_mfileObj != null)
            {
                try
                {
                    _mfileObj.FileNameSet(filePath, string.Empty);
                    _mfileObj.ObjectStart(null);
                    double dblIn, dblOut;

                    try
                    {
                        _mfileObj.FileInOutGet(out dblIn, out dblOut, out dblDuration);

                        if (dblDuration > 0)
                        {
                            MFrame mFrame = null;
                            _mfileObj.FileFrameGet(dblDuration / 2.0, 0.0, out mFrame);
                            long value = 0L;
                            mFrame.FrameVideoGetHbitmap(out value);

                            Marshal.ReleaseComObject(mFrame);
                            mFrame  = null;
                            hBitmap = new System.IntPtr(value);
                        }
                    }
                    finally
                    {
                        _mfileObj.ObjectClose();
                    }
                }
                catch
                {
                    hBitmap = IntPtr.Zero;
                }
            }
            return(hBitmap);
        }
 public bool setFocusFrame(int focusRow, int focusColumn)
 {
     focusX1 = focusX2 = focusColumn;
     focusY1 = focusY2 = focusRow;
     focusState = 1;
     bool tineLineChanged = false;
     if (currentTimeLineHoder != null)
     {
         //激活对应的行
         if (currentTimeLine == null || (currentTimeLine.GetID() != focusRow && focusRow < currentTimeLineHoder.Count()))
         {
             setCurrentTimeLine(focusRow);
             tineLineChanged = true;
         }
         //获得当前点击帧的帧类型
         if (currentTimeLine != null)
         {
             focusFrame = currentTimeLine.getFrameByX(focusColumn);
             focusFrameType = currentTimeLine.getFrameTypeByX(focusColumn);
         }
     }
     return tineLineChanged;
 }
 //清除剪贴板,避免在撤销时造成错误
 public void ClearClipboard()
 {
     bakCopyedKeyFrame = null;
 }
 //复制剪贴板
 public void CopyClipboard()
 {
     if (currentTimeLineHoder == null || currentTimeLine == null || focusFrame==null)
     {
         return;
     }
     bool selectOneFrame = (focusX1 == focusX2 && focusY1 == focusY2 && focusX1 >= 0 && focusY1 >= 0);
     if (!selectOneFrame)
     {
         return;
     }
     bakCopyedKeyFrame = focusFrame.Clone();
 }