Example #1
0
        public int InitDevice()
        {
            DxMediaApi.DXInitialize();
            int CardNum = DxMediaApi.DXGetDeviceCount();

            return(CardNum);
        }
Example #2
0
        public Boolean DisConnectDev(IntPtr CardHandle)
        {
            DxMediaApi.DXStopPreview(CardHandle);
            DxMediaApi.DXDeviceStop(CardHandle);

            return(true);
        }
Example #3
0
 private void btOK_Click(object sender, EventArgs e)
 {
     if (DxMediaFunction.DeviceInfo[Form1.nCard].dwOpenDevState == 0)
     {
         // DxMediaFunction.DeviceInfo[Form1.nCard].dwZoomRect.Left =
         DxMediaFunction.DeviceInfo[Form1.nCard].dwZoomRect.Top    = Convert.ToInt32(txtZoomTop.Text);
         DxMediaFunction.DeviceInfo[Form1.nCard].dwZoomRect.Left   = Convert.ToInt32(txtZoomLeft.Text);
         DxMediaFunction.DeviceInfo[Form1.nCard].dwZoomRect.Right  = Convert.ToInt32(txtZoomRight.Text);
         DxMediaFunction.DeviceInfo[Form1.nCard].dwZoomRect.Bottom = Convert.ToInt32(txtZoomBot.Text);
         if (chkEnableZoom.Checked == true)
         {
             DxMediaApi.DXEnFScale(DxMediaFunction.DeviceInfo[Form1.nCard].dwCardHandle,
                                   true,
                                   ref DxMediaFunction.DeviceInfo[Form1.nCard].dwZoomRect,
                                   0);
         }
         else
         {
             DxMediaApi.DXEnFScale(DxMediaFunction.DeviceInfo[Form1.nCard].dwCardHandle,
                                   false,
                                   ref DxMediaFunction.DeviceInfo[Form1.nCard].dwZoomRect,
                                   0);
         }
     }
 }
Example #4
0
        public int StopRecord(IntPtr CardHandle)
        {
            int ok = 1;

            ok = DxMediaApi.DXStopCapture(CardHandle);
            return(ok);
        }
Example #5
0
        public int FreezeRecord(IntPtr CardHandle, Boolean Enable)
        {
            int ok = 1;

            ok = DxMediaApi.DXFreezeCaputre(CardHandle, Enable);
            return(ok);
        }
Example #6
0
        private void button1_Click(object sender, EventArgs e)
        {
            //
            ScrollBarBrigh.Value      = DevColorInfo[0].DefaultVal;
            ScrollBarContrast.Value   = DevColorInfo[1].DefaultVal;
            ScrollBarSaturation.Value = DevColorInfo[2].DefaultVal;
            ScrollBarSharp.Value      = DevColorInfo[4].DefaultVal;
            ScrollBarHue.Value        = DevColorInfo[3].DefaultVal;

            //
            BrightVal.Text   = System.Convert.ToString(ScrollBarBrigh.Value);
            ContrastVal.Text = System.Convert.ToString(ScrollBarContrast.Value);
            SaturatVal.Text  = System.Convert.ToString(ScrollBarSaturation.Value);
            SharpVal.Text    = System.Convert.ToString(ScrollBarSharp.Value);
            HueVal.Text      = System.Convert.ToString(ScrollBarHue.Value);



            if (DxMediaFunction.DeviceInfo[Form1.nCard].dwOpenDevState == 0)
            {
                for (int i = 0; i < 5; i++)
                {
                    DxMediaApi.DXSetDisplayPara(DxMediaFunction.DeviceInfo[Form1.nCard].dwCardHandle, i, DevColorInfo[i].DefaultVal, 0);
                }
            }
        }
Example #7
0
        //read ini file function
        public string IniReadValue(string Section, string Key, int size, string iniFileName)
        {
            StringBuilder temp = new StringBuilder(500);

            DxMediaApi.GetPrivateProfileString(Section, Key, "", temp, size, iniFileName);
            return(temp.ToString());
        }
Example #8
0
 private void rdX264_CheckedChanged(object sender, EventArgs e)
 {
     if (rdX264.Checked == true)
     {
         DxMediaFunction.DeviceInfo[Form1.nCard].dwVideoCodecStr = "x264 Codec";
         DxMediaApi.WritePrivateProfileString("SystemSetting", "VideoCodec", "x264 Codec", DxMediaFunction.IniFileName);
     }
 }
Example #9
0
        public Boolean ConnectDev(IntPtr CardHandle, int VideoStandard, int ColorSpace, int nWidth, int nHeight, float FrameRate)
        {
            DxMediaApi.DXSetVideoPara(CardHandle, VideoStandard, ColorSpace, nWidth, nHeight, FrameRate);
            DxMediaApi.DXDeviceRun(CardHandle);


            return(true);
        }
Example #10
0
        private void hScrollContract_Scroll(object sender, ScrollEventArgs e)
        {
            DxMediaFunction.ColorPara.nBrightness = hScrollBright.Value;
            DxMediaFunction.ColorPara.nContrast   = hScrollContract.Value;
            ContractValue.Text = System.Convert.ToString(hScrollContract.Value);

            DxMediaApi.DXEnDataRaterPara(DxMediaFunction.DeviceInfo[Form1.nCard].dwCardHandle, 0, ref DxMediaFunction.ColorPara);
        }
Example #11
0
 private void ScrollBarHue_Scroll(object sender, ScrollEventArgs e)
 {
     DxMediaFunction.HueValue = ScrollBarHue.Value;
     HueVal.Text = System.Convert.ToString(ScrollBarHue.Value);
     if (DxMediaFunction.DeviceInfo[Form1.nCard].dwOpenDevState == 0)
     {
         DxMediaApi.DXSetDisplayPara(DxMediaFunction.DeviceInfo[Form1.nCard].dwCardHandle, 3, DxMediaFunction.HueValue, 0);
         DxMediaApi.WritePrivateProfileString("VideoPar", " Hue" + Convert.ToString(Form1.nCard), HueVal.Text, DxMediaFunction.IniFileName);
     }
 }
Example #12
0
 public void SnapPicture(IntPtr CardHandle, string SaveName, int PictureType, DxMediaApi.RECT SnapRect)
 {
     if (PictureType == 0)
     {
         DxMediaApi.DXSnapToBMPFile(CardHandle, SaveName, ref SnapRect);
     }
     else
     {
         DxMediaApi.DXSnapToJPGFile(CardHandle, SaveName, 100, ref SnapRect);
     }
 }
Example #13
0
 private void checkTxtTranspar2_CheckedChanged(object sender, EventArgs e)
 {
     if (checkTxtTranspar2.Checked == true)
     {
         DxMediaApi.WritePrivateProfileString("OSDPar", "Text2OsdTranspar", "Enable", DxMediaFunction.IniFileName);
     }
     else
     {
         DxMediaApi.WritePrivateProfileString("OSDPar", "Text2OsdTranspar", "Disable", DxMediaFunction.IniFileName);
         checkTxtTranspar2.Checked = false;
     }
 }
Example #14
0
 private void hScrollBar1_Scroll(object sender, ScrollEventArgs e)
 {
     //set picture osd parameter, disable transparent
     DxMediaApi.DXSetPictureOSD(DxMediaFunction.DeviceInfo[Form1.nCard].dwCardHandle,
                                TosdInfoVal[1].PicPlaceX,
                                TosdInfoVal[1].PicPlaceY,
                                0,
                                TosdInfoVal[1].PicOsdFile,
                                true,
                                Convert.ToChar(hScrollBar1.Value));
     DxMediaApi.DXEnOSDDisp(DxMediaFunction.DeviceInfo[Form1.nCard].dwCardHandle,
                            2,
                            0,
                            true);
 }
Example #15
0
        private void btOk_Click(object sender, EventArgs e)
        {
            //////////Create the save directoy start//////////////////////////
            if (!Directory.Exists(TxtPicPath.Text))         //判断是否存在
            {
                Directory.CreateDirectory(TxtPicPath.Text); //创建新路径
            }

            if (!Directory.Exists(TxtRecPath.Text))         //判断是否存在
            {
                Directory.CreateDirectory(TxtRecPath.Text); //创建新路径
            }
            //PicSavePath
            DxMediaFunction.PicSavePath = TxtPicPath.Text;
            DxMediaFunction.RecSavePath = TxtRecPath.Text;
            DxMediaApi.WritePrivateProfileString("SystemSetting", "PicSaveParh", TxtPicPath.Text, DxMediaFunction.IniFileName);

            DxMediaApi.WritePrivateProfileString("SystemSetting", "VideoSaveParh", TxtRecPath.Text, DxMediaFunction.IniFileName);

            //////////Create the save directoy end//////////////////////////


            ///////////////////Set the video Codec Name Start/////////////////////
            if (rdXvid.Checked == true)
            {
                DxMediaFunction.DeviceInfo[Form1.nCard].dwVideoCodecStr = "xvid Codec";
            }

            if (rdDivx.Checked == true)
            {
                DxMediaFunction.DeviceInfo[Form1.nCard].dwVideoCodecStr = "DivX? 5.1.1 Codec";
            }

            if (rdX264.Checked == true)
            {
                DxMediaFunction.DeviceInfo[Form1.nCard].dwVideoCodecStr = "x264 Codec";
            }

            DxMediaApi.WritePrivateProfileString("SystemSetting", "VideoCodec", DxMediaFunction.DeviceInfo[Form1.nCard].dwVideoCodecStr, DxMediaFunction.IniFileName);

            ///////////////////Set the video Codec Name End/////////////////////////////////



            this.Close();
        }
Example #16
0
        private void btBrowse_Click(object sender, EventArgs e)
        {
            // string PicPathFile = "";


            OpenFileDialog openFileDialog1 = new OpenFileDialog();

            //define open default path
            openFileDialog1.InitialDirectory = "D://";
            //define open file type
            openFileDialog1.Filter           = "All files (*.*)|*.*|bmp files (*.bmp)|*.bmp";
            openFileDialog1.FilterIndex      = 2;
            openFileDialog1.RestoreDirectory = true;
            if (openFileDialog1.ShowDialog() == DialogResult.OK)
            {
                TosdInfoVal[1].PicOsdFile = openFileDialog1.FileName;
            }

            TxtPicPath.Text = TosdInfoVal[1].PicOsdFile;
            DxMediaApi.WritePrivateProfileString("OSDPar", "OsdPicFile", TosdInfoVal[1].PicOsdFile, DxMediaFunction.IniFileName);
        }
Example #17
0
 public void GetVideoPara(IntPtr CardHandle, int nWidth, int nHeight, int nColorSpace, int VideoStandard, float FrameRate)
 {
     DxMediaApi.DXGetVideoPara(CardHandle, ref VideoStandard, ref nColorSpace, ref nWidth, ref nHeight, ref FrameRate);
 }
Example #18
0
 private void button1_Click(object sender, EventArgs e)
 {
     DxMediaApi.DXEnableDenoise(DxMediaFunction.DeviceInfo[Form1.nCard].dwCardHandle, hScrollDenoise.Value);
     DxMediaApi.DXEnableSharpen(DxMediaFunction.DeviceInfo[Form1.nCard].dwCardHandle, hScrollSharp.Value);
 }
Example #19
0
        public int StartRecord(IntPtr CardHandle, string SaveName, string CodecName, DxMediaApi.TVidCodecX264Para dwH264CodecPara, Boolean AudioRec)
        {
            DxMediaApi.TDEVICE_TAG[] VidCodecInfo = new DxMediaApi.TDEVICE_TAG[125];
            DxMediaApi.TDEVICE_TAG[] AuCodecInfo  = new DxMediaApi.TDEVICE_TAG[125];
            int CodecNum   = 32;
            int CurCodec   = 0;
            int AuCodecNum = 32;
            int AuCurCodec = 0;

            int    Size          = Marshal.SizeOf(typeof(DxMediaApi.TDEVICE_TAG)) * 32;
            IntPtr VideoCodecBuf = Marshal.AllocHGlobal(Size);
            IntPtr AudioCodecBuf = Marshal.AllocHGlobal(Size);


            //enum the video Codec
            DxMediaApi.DXEnumVideoCodecs(VideoCodecBuf, ref CodecNum);


            //enum the audio Codec
            DxMediaApi.DXEnumVideoCodecs(AudioCodecBuf, ref AuCodecNum);


            //set the video codec
            for (int i = 0; i < CodecNum; i++)
            {
                IntPtr VidCodecBuf = new IntPtr(VideoCodecBuf.ToInt64() + Marshal.SizeOf(typeof(DxMediaApi.TDEVICE_TAG)) * i);
                VidCodecInfo[i] = (DxMediaApi.TDEVICE_TAG)Marshal.PtrToStructure(VidCodecBuf, typeof(DxMediaApi.TDEVICE_TAG));

                //set video codec
                if (VidCodecInfo[i].Name.ToLower() == CodecName.ToLower())
                {
                    CurCodec = i;
                    break;
                }
            }

            //set the audio codec
            for (int i = 0; i < AuCodecNum; i++)
            {
                IntPtr AudCodecBuf = new IntPtr(AudioCodecBuf.ToInt64() + Marshal.SizeOf(typeof(DxMediaApi.TDEVICE_TAG)) * i);
                AuCodecInfo[i] = (DxMediaApi.TDEVICE_TAG)Marshal.PtrToStructure(AudCodecBuf, typeof(DxMediaApi.TDEVICE_TAG));

                //set video codec
                if (AuCodecInfo[i].Name.ToLower() == CodecName.ToLower())
                {
                    AuCurCodec = i;
                    break;
                }
            }
            //set the video codec
            DxMediaApi.DXSetVideoCodec(CardHandle, ref VidCodecInfo[CurCodec]);

            if (AudioRec == true)
            {
                DxMediaApi.DXSetAudioCodec(CardHandle, ref AuCodecInfo[AuCurCodec]);
            }
            //////////////////set the x264 video codec parameter
            string X264Name = "x264 Codec";
            string XvidName = "xvid Codec";

            if (VidCodecInfo[CurCodec].Name.ToLower() == X264Name.ToLower() || VidCodecInfo[CurCodec].Name.ToLower() == XvidName.ToLower())
            {
                DxMediaApi.DXSetVideoCodecPara(CardHandle, 1, ref dwH264CodecPara);
            }

            Marshal.FreeHGlobal(VideoCodecBuf);
            Marshal.FreeHGlobal(AudioCodecBuf);
            //  Marshal.FreeHGlobal(AudCodecBuf);
            // Marshal.FreeHGlobal(VidCodecBuf);

            int   ok = 1;
            Point Notify;
            int   nTimeValue = 0;
            int   nSizeValue = 0;

            Notify = new Point();

            ok = DxMediaApi.DXStartCapture(CardHandle, SaveName, AudioRec, ref nTimeValue, ref nSizeValue, Notify);
            return(ok);
        }
Example #20
0
 public void StopPrview(IntPtr CardHandle)
 {
     DxMediaApi.DXStopPreview(CardHandle);
 }
Example #21
0
        private void CodecSetFrm_Load(object sender, EventArgs e)
        {
            if (DxMediaFunction.DeviceInfo[Form1.nCard].dwVideoCodecStr == "DivX? 5.1.1 Codec")
            {
                rdDivx.Checked = true;
            }

            if (DxMediaFunction.DeviceInfo[Form1.nCard].dwVideoCodecStr == "XviD MPEG-4 Codec")
            {
                rdXvid.Checked = true;
            }

            if (DxMediaFunction.DeviceInfo[Form1.nCard].dwVideoCodecStr == "x264 Codec")
            {
                rdX264.Checked = true;
            }


            VideoCodecNum = 32;
            AudioCodecNum = 32;
            VideoCurCodec = 0;
            AudioCurCodec = 0;
            int i;

            for (i = 0; i < 125; i++)
            {
                VideoCodecInfo[i].idx  = 0;
                VideoCodecInfo[i].Name = "";
                AudioCodecInfo[i].idx  = 0;
                AudioCodecInfo[i].Name = "";
            }
            int    Size          = Marshal.SizeOf(typeof(DxMediaApi.TDEVICE_TAG)) * 32;
            IntPtr VideoCodecBuf = Marshal.AllocHGlobal(Size);
            IntPtr AudioCodecBuf = Marshal.AllocHGlobal(Size);

            //enum the video and the audio codec
            DxMediaApi.DXEnumVideoCodecs(VideoCodecBuf, ref VideoCodecNum);
            DxMediaApi.DXEnumAudioCodecs(AudioCodecBuf, ref AudioCodecNum);


            for (int j = 0; j < 32; j++)
            {
                IntPtr VidCodecBuf = new IntPtr(VideoCodecBuf.ToInt64() + Marshal.SizeOf(typeof(DxMediaApi.TDEVICE_TAG)) * j);
                VideoCodecInfo[j] = (DxMediaApi.TDEVICE_TAG)Marshal.PtrToStructure(VidCodecBuf, typeof(DxMediaApi.TDEVICE_TAG));

                IntPtr AudCodecBuf = new IntPtr(AudioCodecBuf.ToInt64() + Marshal.SizeOf(typeof(DxMediaApi.TDEVICE_TAG)) * j);
                AudioCodecInfo[j] = (DxMediaApi.TDEVICE_TAG)Marshal.PtrToStructure(AudCodecBuf, typeof(DxMediaApi.TDEVICE_TAG));
            }
            Marshal.FreeHGlobal(VideoCodecBuf);
            Marshal.FreeHGlobal(AudioCodecBuf);


            for (i = 0; i < VideoCodecNum; i++)
            {
                VideoCodecStr[i] = VideoCodecInfo[i].Name;
                comboBoxVidCodec.Items.Add(VideoCodecStr[i]);


                if ((VideoCodecStr[i] == "XviD MPEG-4 Codec") || (VideoCodecStr[i] == "Xvid MPEG-4 Codec"))
                {
                    VideoCurCodec = i;
                }

                comboBoxVidCodec.SelectedIndex = VideoCurCodec;
            }
            for (i = 0; i < AudioCodecNum; i++)
            {
                AudioCodecStr[i] = AudioCodecInfo[i].Name;
                comboBoxAudCodec.Items.Add(AudioCodecStr[i]);
                if (AudioCodecStr[i] == "Microsoft ADPCM")
                {
                    AudioCurCodec = i;
                }
                comboBoxAudCodec.SelectedIndex = AudioCurCodec;
            }
        }
Example #22
0
        public IntPtr OpenDevice(int nCard, ref int OpenDevState)
        {
            IntPtr DeviceHandle = DxMediaApi.DXOpenDevice(nCard, ref OpenDevState);

            return(DeviceHandle);
        }
Example #23
0
        private void button1_Click(object sender, EventArgs e)
        {
            IntPtr TextOsd1 = Marshal.StringToHGlobalAnsi(TosdInfoVal[1].Osd_Txtstring);
            IntPtr TextOsd2 = Marshal.StringToHGlobalAnsi(TosdInfoVal[2].Osd_Txtstring);

            if (DxMediaFunction.DeviceInfo[Form1.nCard].dwOpenDevState == 0)
            {
                if (checkTimeEn.Checked == true)
                {
                    if (checkTimeTranspar.Checked == true)
                    {
                        //set time osd parameter, enable transparent
                        DxMediaApi.DXSetTimeOSD(DxMediaFunction.DeviceInfo[Form1.nCard].dwCardHandle,
                                                TosdInfoVal[1].TimeX,
                                                TosdInfoVal[1].TimeY,
                                                TosdInfoVal[1].TimeFontSizeVal,
                                                "Arial",
                                                TosdInfoVal[1].TimeColor,
                                                BackColor,
                                                true);
                    }
                    else
                    {
                        //set time osd parameter, disable transparent
                        DxMediaApi.DXSetTimeOSD(DxMediaFunction.DeviceInfo[Form1.nCard].dwCardHandle,
                                                TosdInfoVal[1].TimeX,
                                                TosdInfoVal[1].TimeY,
                                                TosdInfoVal[1].TimeFontSizeVal,
                                                "Arial",
                                                TosdInfoVal[1].TimeColor,
                                                BackColor,
                                                false);
                    }

                    //enable the time osd
                    DxMediaApi.DXEnOSDDisp(DxMediaFunction.DeviceInfo[Form1.nCard].dwCardHandle,
                                           0,
                                           0,
                                           true);
                }
                else
                {
                    //disable the time osd
                    DxMediaApi.DXEnOSDDisp(DxMediaFunction.DeviceInfo[Form1.nCard].dwCardHandle,
                                           0,
                                           0,
                                           false);
                }

                if (checkTxtEn1.Checked == true)
                {
                    if (checkTxtTranspar1.Checked == true)
                    {
                        //set text osd parameter, enable transparent
                        DxMediaApi.DXSetTextOSD(DxMediaFunction.DeviceInfo[Form1.nCard].dwCardHandle,
                                                TosdInfoVal[1].TxtPlaceX,
                                                TosdInfoVal[1].TxtPlaceY,
                                                0,
                                                TextOsd1,
                                                TosdInfoVal[1].TxtFontSizeVal,
                                                "Arial",
                                                TosdInfoVal[1].TxtColor,
                                                BackColor,
                                                true);
                    }
                    else
                    {
                        //   //set time osd parameter, disable transparent
                        DxMediaApi.DXSetTextOSD(DxMediaFunction.DeviceInfo[Form1.nCard].dwCardHandle,
                                                TosdInfoVal[1].TxtPlaceX,
                                                TosdInfoVal[1].TxtPlaceY,
                                                0,
                                                TextOsd1,
                                                TosdInfoVal[1].TxtFontSizeVal,
                                                "Arial",
                                                TosdInfoVal[1].TxtColor,
                                                BackColor,
                                                false);
                    }
                    // enable the first line of text osd

                    DxMediaApi.DXEnOSDDisp(DxMediaFunction.DeviceInfo[Form1.nCard].dwCardHandle,
                                           1,
                                           0,
                                           true);
                }
                else
                {
                    // disable the first line of text osd
                    DxMediaApi.DXEnOSDDisp(DxMediaFunction.DeviceInfo[Form1.nCard].dwCardHandle,
                                           1,
                                           0,
                                           false);
                }


                if (checkTxtEn2.Checked == true)
                {
                    if (checkTxtTranspar2.Checked == true)
                    {
                        //set text osd parameter, enable transparent
                        DxMediaApi.DXSetTextOSD(DxMediaFunction.DeviceInfo[Form1.nCard].dwCardHandle,
                                                TosdInfoVal[2].TxtPlaceX,
                                                TosdInfoVal[2].TxtPlaceY,
                                                1,
                                                TextOsd2,
                                                TosdInfoVal[2].TxtFontSizeVal,
                                                "Arial",
                                                TosdInfoVal[2].TxtColor,
                                                BackColor,
                                                true);
                    }
                    else
                    {
                        //   //set time osd parameter, disable transparent
                        DxMediaApi.DXSetTextOSD(DxMediaFunction.DeviceInfo[Form1.nCard].dwCardHandle,
                                                TosdInfoVal[2].TxtPlaceX,
                                                TosdInfoVal[2].TxtPlaceY,
                                                1,
                                                TextOsd2,
                                                TosdInfoVal[2].TxtFontSizeVal,
                                                "Arial",
                                                TosdInfoVal[2].TxtColor,
                                                BackColor,
                                                false);
                    }
                    // enable the second line of text osd

                    DxMediaApi.DXEnOSDDisp(DxMediaFunction.DeviceInfo[Form1.nCard].dwCardHandle,
                                           1,
                                           1,
                                           true);
                }
                else
                {
                    // disable the second line of text osd
                    DxMediaApi.DXEnOSDDisp(DxMediaFunction.DeviceInfo[Form1.nCard].dwCardHandle,
                                           1,
                                           1,
                                           false);
                }

                /*
                 * if (checkEnablePic.Checked == true)
                 * {
                 *   //set picture osd parameter, disable transparent
                 *   DxMediaApi.DXSetPictureOSD(DxMediaFunction.DeviceInfo[Form1.nCard].dwCardHandle,
                 *                              TosdInfoVal[1].PicPlaceX,
                 *                              TosdInfoVal[1].PicPlaceY,
                 *                              0,
                 *                              TosdInfoVal[1].PicOsdFile,
                 *                              true,
                 *                              Convert.ToChar(255));
                 *   DxMediaApi.DXEnOSDDisp(DxMediaFunction.DeviceInfo[Form1.nCard].dwCardHandle,
                 *                         2,
                 *                         0,
                 *                         true);
                 * }
                 * else
                 * {
                 *   DxMediaApi.DXEnOSDDisp(DxMediaFunction.DeviceInfo[Form1.nCard].dwCardHandle,
                 *                          2,
                 *                          0,
                 *                          false);
                 * }*/
            }
        }
Example #24
0
 //write ini file function
 public void IniWriteValue(string Section, string Key, string Value, string iniFileName)
 {
     DxMediaApi.WritePrivateProfileString(Section, Key, Value, iniFileName);
 }
Example #25
0
        public int StartPrview(IntPtr CardHandle, IntPtr PrvHwnd, DxMediaApi.RECT PrvRect, int PrvModle)
        {
            int ok = DxMediaApi.DXStartPreview(CardHandle, PrvHwnd, ref PrvRect, PrvModle);

            return(ok);
        }
Example #26
0
 private void TxtOsd2_TextChanged(object sender, EventArgs e)
 {
     TosdInfoVal[2].Osd_Txtstring = TxtOsd2.Text;
     DxMediaApi.WritePrivateProfileString("OSDPar", "OsdText2", TosdInfoVal[2].Osd_Txtstring, DxMediaFunction.IniFileName);
 }
Example #27
0
 public void UnInitDevice()
 {
     DxMediaApi.DXUninitialize();
 }
Example #28
0
        private void ColorSetting_Load(object sender, EventArgs e)
        {
            int i;

            for (i = 0; i < 16; i++)
            {
                DevColorInfo[i].MinVal     = 0;
                DevColorInfo[i].MaxVal     = 0;
                DevColorInfo[i].DefaultVal = 0;
                DevColorInfo[i].ColorType  = 0;
                DevColorInfo[i].StepVal    = 0;
                DevColorInfo[i].CurVal     = 0;
            }
            if (DxMediaFunction.DeviceInfo[Form1.nCard].dwOpenDevState == 0)
            {
                for (i = 0; i < 5; i++)
                {
                    DxMediaApi.DXGetDisplayParaRange(DxMediaFunction.DeviceInfo[Form1.nCard].dwCardHandle, i,
                                                     ref DevColorInfo[i].MinVal,
                                                     ref DevColorInfo[i].MaxVal,
                                                     ref DevColorInfo[i].StepVal,
                                                     ref DevColorInfo[i].DefaultVal,
                                                     ref iFlags);
                }
            }
            //
            ScrollBarBrigh.Maximum     = DevColorInfo[0].MaxVal;
            ScrollBarBrigh.Minimum     = DevColorInfo[0].MinVal;
            ScrollBarBrigh.LargeChange = DevColorInfo[0].StepVal;
            ScrollBarBrigh.Value       = DevColorInfo[0].DefaultVal;

            //
            ScrollBarContrast.Maximum     = DevColorInfo[1].MaxVal;
            ScrollBarContrast.Minimum     = DevColorInfo[1].MinVal;
            ScrollBarContrast.LargeChange = DevColorInfo[1].StepVal;
            ScrollBarContrast.Value       = DevColorInfo[1].DefaultVal;

            //
            ScrollBarSaturation.Maximum     = DevColorInfo[2].MaxVal;
            ScrollBarSaturation.Minimum     = DevColorInfo[2].MinVal;
            ScrollBarSaturation.LargeChange = DevColorInfo[2].StepVal;
            ScrollBarSaturation.Value       = DevColorInfo[2].DefaultVal;

            //
            ScrollBarHue.Maximum     = DevColorInfo[3].MaxVal;
            ScrollBarHue.Minimum     = DevColorInfo[3].MinVal;
            ScrollBarHue.LargeChange = DevColorInfo[3].StepVal;
            ScrollBarHue.Value       = DevColorInfo[3].DefaultVal;

            //
            ScrollBarSharp.Maximum     = DevColorInfo[4].MaxVal;
            ScrollBarSharp.Minimum     = DevColorInfo[4].MinVal;
            ScrollBarSharp.LargeChange = DevColorInfo[4].StepVal;
            //  ScrollBarSharp.Value = DevColorInfo[4].DefaultVal;

            //
            BrightVal.Text   = System.Convert.ToString(ScrollBarBrigh.Value);
            ContrastVal.Text = System.Convert.ToString(ScrollBarContrast.Value);
            SaturatVal.Text  = System.Convert.ToString(ScrollBarSaturation.Value);
            SharpVal.Text    = System.Convert.ToString(ScrollBarSharp.Value);
            HueVal.Text      = System.Convert.ToString(ScrollBarHue.Value);
        }
Example #29
0
 public Boolean CloseDevice(IntPtr CardHandle)
 {
     DxMediaApi.DXCloseDevice(CardHandle);
     return(true);
 }
Example #30
0
 private void hScrollBar2_Scroll(object sender, ScrollEventArgs e)
 {
     DxMediaApi.DXEnableSharpen(DxMediaFunction.DeviceInfo[Form1.nCard].dwCardHandle, hScrollSharp.Value);
     SharpValue.Text = System.Convert.ToString(hScrollSharp.Value);
 }