MFORMATSLib Namespace > IMFFrame Interface : MFResize Method |
Sub MFResize( _ ByVal _fccOutput As eMFCC, _ ByVal _nWidth As Integer, _ ByVal _nHeight As Integer, _ ByVal _nResizeField As Integer, _ ByRef _ppFrameRes As MFFrame, _ ByVal _bsPropsList As String, _ ByVal _bsConverterID As String _ )
void MFResize( eMFCC _fccOutput, int _nWidth, int _nHeight, int _nResizeField, out MFFrame _ppFrameRes, string _bsPropsList, string _bsConverterID )
procedure MFResize( _fccOutput: eMFCC; _nWidth: Integer; _nHeight: Integer; _nResizeField: Integer; Out _ppFrameRes: MFFrame; _bsPropsList: String; _bsConverterID: String );
void MFResize( eMFCC _fccOutput, int _nWidth, int _nHeight, int _nResizeField, [PARAMFLAG::Out] MFFrame* _ppFrameRes, BSTR* _bsPropsList, BSTR* _bsConverterID )
Here is an example of how to get a frame from a source, resize it and save it into a file:
m_objPreview = new MFPreviewClass(); //Configure preview m_objPreview.PreviewWindowSet("", panelPreview.Handle.ToInt32()); m_objPreview.PreviewEnable("", 1, 1); m_objMFReader = new MFReaderClass(); m_objMFReader.ReaderOpen(sourceFileName, ""); m_avProps = new M_AV_PROPS(); // set video format for conversion m_avProps.vidProps.eVideoFormat = eMVideoFormat.eMVF_HD1080_5994i; MFFrame pFrame = null; // Get next frame if (m_objMFReader != null) m_objMFReader.SourceFrameConvertedGetByTime(ref m_avProps, -1, -1, out pFrame, ""); m_objPreview.ReceiverFramePut(pFrame, -1, ""); // show the frame on preview MFFrame resizedFrame; pFrame.MFResize(eMFCC.eMFCC_Default, 1000, 700, 0, out resizedFrame, "", ""); resizedFrame.MFVideoSaveToFile(@"c:\resizedTest.png");