private void Lshape_chb_CheckedChanged(object sender, EventArgs e) { string graphicsItemId = "myImage"; if (LShape == 1) { string pathToImageFile = LShapePath_txb.Text;//@"E:\!temp\etere pte ltd_1024x576_L Shape-12.png"; double relativeX = 0.00; double relativeY = 0.00; int isRelative = 1; int isShow = 0; m_objCharGen.AddNewItem(pathToImageFile, relativeX, relativeY, isRelative, isShow, ref graphicsItemId); m_objCharGen.SetItemSize(graphicsItemId, 1920, 1080, 0, 0); m_objCharGen.ShowItem(graphicsItemId, 1, 1000); MLCHARGENLib.tagRECT trSource = new MLCHARGENLib.tagRECT(); trSource.top = 0; trSource.left = 0; trSource.bottom = 0; trSource.right = 0; MLCHARGENLib.tagRECT trTarget = new MLCHARGENLib.tagRECT(); trTarget.top = 0; trTarget.left = 270; trTarget.bottom = 740; trTarget.right = 1920; m_objCharGen.SetVideoOutputRectWithDelay(trSource, trTarget, 0, 1, 0, 1000); //m_objCharGen.SetVideoOutputRect(trSource, trTarget, 0, 1); // I specify the destination rectangle assuming that my video resolution is 1920x1080 } else if (LShape == 0) { // Tatget and source rectangles MLCHARGENLib.tagRECT trSource = new MLCHARGENLib.tagRECT(); MLCHARGENLib.tagRECT trTarget = new MLCHARGENLib.tagRECT(); // Transform a video into the original state within 1 second m_objCharGen.SetVideoOutputRectWithDelay(trSource, trTarget, 0, 1, 0, 1000); m_objCharGen.RemoveItem(graphicsItemId, 1000); } LShape = LShape == 0 ? 1 : 0; }
private void checkBoxCG_CheckedChanged(object sender, EventArgs e) { if (m_objCharGen != null) { m_objMixer.PluginsRemove(m_objCharGen); System.Runtime.InteropServices.Marshal.ReleaseComObject(m_objCharGen); m_objCharGen = null; m_strItemID = ""; CGProps.Enabled = false; } if (checkBoxCG.Checked) { m_objCharGen = new MLCHARGENLib.CoMLCharGen(); m_objMixer.PluginsAdd(m_objCharGen, 0); m_objCharGen.AddNewItem("MediaLooks", 0.1, 0.1, 1, 1, ref m_strItemID); m_objCharGen.SetItemProperties(m_strItemID, "movement::speed-x", "1", "", 0); m_objCharGen.ShowItem(m_strItemID, 1, 1000); CGProps.Enabled = true; } }