How to manually implement zoom effect

Add VisioForge.MediaFramework assembly reference to your application.

Sample code for Media Player SDK .Net Main Demo.      

private IntPtr tempBuffer = IntPtr.Zero;

private void MediaPlayer1_OnVideoFrameBuffer2(object sender, VideoFrameBufferEventArgs2 e) {
    if (tempBuffer == IntPtr.Zero) {
        tempBuffer = Marshal.AllocCoTaskMem(e.BufferLen);
    }

    const double zoom = 2.0;
    VisioForge.MediaFramework.MFP.MFP.EffectZoom(e.Buffer, e.Width, e.Height, tempBuffer, zoom, zoom, 0, 0);

    VisioForge.MediaFramework.MFP.MFP.CopyMemory(tempBuffer, e.Buffer, e.BufferLen);
}

VisioForge © 2006-2019

  • GitHub-Mark-64px
  • Twitter Социальные Иконка
  • VisioForge Facebook page
  • YouTube channel