Пример #1
0
        void NewInputFrame(BabylonMS.BMSEventSessionParameter session) //from ScreenCapture
        {
            BabylonMS.BMSField rect = session.inputPack.GetFieldByName("RECT");
            if (rect != null)
            {
                try
                {
                    if ((focused != null) && (focused == this))
                    {
                        frame[0] = (Int16)rect.getValue(0);
                        frame[1] = (Int16)rect.getValue(1);
                        frame[2] = (Int16)rect.getValue(2);
                        frame[3] = (Int16)rect.getValue(3);
                    }
                }
                catch (Exception) { }
            }
            byte[] buffer = session.inputPack.GetField(0).getValue();


            if (++CCC1 % 50 == 0)
            {
                Console.WriteLine("Inputframenum:" + CCC1.ToString());
            }
            {
                {
                    //Store screencapture image to Imagebuffer
                    IBIface.session.outputPack.Clear();
                    IBIface.session.outputPack.AddField("CMD", BabylonMS.BabylonMS.CONST_FT_INT8).
                    Value(VRCEShared.CONST_COMMAND_STORE);
                    IBIface.session.outputPack.AddField("HWND", BabylonMS.BabylonMS.CONST_FT_INT64).
                    Value(Hwnd);
                    IBIface.session.outputPack.AddField("GROUP", BabylonMS.BabylonMS.CONST_FT_UUID).
                    ValueAsUUID(Program.instanceUUID);
                    IBIface.session.outputPack.AddField("IMAGE", BabylonMS.BabylonMS.CONST_FT_BYTE).
                    Value(buffer);
                    try
                    {
                        IBIface.session.TransferPacket(true); //to Imagebuffer
                    }
                    catch (Exception)
                    {
                    }
                    //I Don't check buffered or not
                    // Partner class start Notice with modified content to Partner
                }
            }
        }
Пример #2
0
        static void NewInputFrame(BabylonMS.BMSEventSessionParameter session)
        {
            screensession = session;
            BabylonMS.BMSField cmdfield = session.inputPack.GetField(0);
            byte cmd = (byte)cmdfield.getValue(0);//CMD

            switch (cmd)
            {
            case VRMainContentExporter.VRCEShared.CONST_CAPTURE_START:
            {
                Int64 inp = session.inputPack.GetFieldByName("HWND").getValue(0);
                mintime = (uint)session.inputPack.GetFieldByName("MINTIME").getValue(0);
                if (inp == 0)
                {
                    hwnd = ContentCapture.User32.GetDesktopWindow();         //desktop
                }
                else
                {
                    hwnd = new IntPtr(inp);         //Window
                }
                datavalid = true;
                break;
            }

            case VRMainContentExporter.VRCEShared.CONST_CAPTURE_FOCUS_WINDOW:
            {
                //mert a következő Continous miatt ennek kell lennie
                //cmdfield.clearValue().Value(VRMainContentExporter.VRCEShared.CONST_CAPTURE_START);
                if (hwnd != IntPtr.Zero)
                {
                    ContentCapture.User32.ForceWindowToForeground(hwnd);
                    ContentCapture.User32.SetForegroundWindow(hwnd);
                    restrictArea(hwnd, true, false);
                }
                break;
            }
            }
        }