diff --git a/samples/VCLDemo/vclIPCameraCapture/VCLIPCameraCapture.dpr b/samples/VCLDemo/vclIPCameraCapture/VCLIPCameraCapture.dpr new file mode 100644 index 0000000..4e8172b --- /dev/null +++ b/samples/VCLDemo/vclIPCameraCapture/VCLIPCameraCapture.dpr @@ -0,0 +1,40 @@ +(* /***************************************************************** + // Delphi-OpenCV Demo + // Copyright (C) 2013 Project Delphi-OpenCV + // **************************************************************** + // Contributor: + // laentir Valetov + // email:laex@bk.ru + // **************************************************************** + // You may retrieve the latest version of this file at the GitHub, + // located at git://github.com/Laex/Delphi-OpenCV.git + // **************************************************************** + // The contents of this file are used with permission, subject to + // the Mozilla Public License Version 1.1 (the "License"); you may + // not use this file except in compliance with the License. You may + // obtain a copy of the License at + // http://www.mozilla.org/MPL/MPL-1_1Final.html + // + // Software distributed under the License is distributed on an + // "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + // implied. See the License for the specific language governing + // rights and limitations under the License. + ******************************************************************* *) +// JCL_DEBUG_EXPERT_GENERATEJDBG OFF +// JCL_DEBUG_EXPERT_INSERTJDBG OFF +// JCL_DEBUG_EXPERT_DELETEMAPFILE OFF + +program VCLIPCameraCapture; + +uses + Vcl.Forms, + uMainForm in 'uMainForm.pas' {MainForm}; + +{$R *.res} + +begin + Application.Initialize; + Application.MainFormOnTaskbar := True; + Application.CreateForm(TMainForm, MainForm); + Application.Run; +end. diff --git a/samples/VCLDemo/vclIPCameraCapture/VCLIPCameraCapture.dproj b/samples/VCLDemo/vclIPCameraCapture/VCLIPCameraCapture.dproj new file mode 100644 index 0000000..38f9341 --- /dev/null +++ b/samples/VCLDemo/vclIPCameraCapture/VCLIPCameraCapture.dproj @@ -0,0 +1,169 @@ + + + {E7756997-05DF-48F3-A962-1BDDF464DDC0} + 14.6 + VCL + VCLIPCameraCapture.dpr + True + Debug + Win32 + 1 + Application + + + true + + + true + Base + true + + + true + Base + true + + + true + Base + true + + + true + Cfg_1 + true + true + + + true + Base + true + + + true + Cfg_2 + true + true + + + None + $(BDS)\bin\delphi_PROJECTICON.ico + 1049 + System;Xml;Data;Datasnap;Web;Soap;Vcl;Vcl.Imaging;Vcl.Touch;Vcl.Samples;Vcl.Shell;$(DCC_Namespace) + CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments= + .\$(Platform)\$(Config) + ..\..\..\bin\ + false + false + false + false + false + + + $(BDS)\bin\default_app.manifest + Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace) + 1033 + true + cxPivotGridChartRS17;JvGlobus;JvMM;dxSkinSevenRS17;dxSkinBlueprintRS17;JvManagedThreads;dxSkinHighContrastRS17;dxSkinOffice2007BlackRS17;dxCoreRS17;dac170;cxPageControldxBarPopupMenuRS17;dxSkinXmas2008BlueRS17;dxPSDBTeeChartRS17;GLS_ODE;JvCrypt;dxPSTeeChartRS17;dxSkinSummer2008RS17;dxPScxSchedulerLnkRS17;dxSkinBlueRS17;dxSkinDarkRoomRS17;DBXInterBaseDriver;DataSnapServer;DataSnapCommon;dxPScxTLLnkRS17;JvNet;GLScene_RunTime;officeXPrt;JvDotNetCtrls;dxRibbonRS17;DbxCommonDriver;cxDataRS17;vclimg;dxSkinsdxBarPainterRS17;dxPSdxDBTVLnkRS17;dbxcds;DatasnapConnectorsFreePascal;dxSkinMoneyTwinsRS17;JvXPCtrls;vcldb;cxExportRS17;dxPSCoreRS17;dxBarExtItemsRS17;dxGDIPlusRS17;dxNavBarRS17;CustomIPTransport;cxLibraryRS17;cxGridRS17;dxSkinOffice2010BlackRS17;dsnap;IndyIPServer;unidac170;IndyCore;dxSkinMcSkinRS17;CloudService;dxPScxCommonRS17;FmxTeeUI;frxDB17;dxSkinsdxDLPainterRS17;dxSkiniMaginaryRS17;AnyDAC_PhysDb2_D17;JvDB;JvRuntimeDesign;dxPScxVGridLnkRS17;JclDeveloperTools;unidacfmx170;dxSkinSevenClassicRS17;dxPScxExtCommonRS17;dxPScxSSLnkRS17;dxSkinLilianRS17;fs17;dxPSdxLCLnkRS17;dxSkinOffice2010BlueRS17;bindcompfmx;dclTP_LockBox3;dxSkinOffice2010SilverRS17;vcldbx;cxSchedulerGridRS17;dbrtl;bindcomp;inetdb;JvPluginSystem;dxBarRS17;IcsCommonDXE3Run;DBXOdbcDriver;dxBarDBNavRS17;JvCmp;dxSkinWhiteprintRS17;JvTimeFramework;xmlrtl;dxSkinsdxRibbonPainterRS17;ibxpress;GLSS_OpenAL;dxDockingRS17;bindengine;vclactnband;soaprtl;FMXTee;dxADOServerModeRS17;bindcompvcl;dxBarExtDBItemsRS17;PasLib;Jcl;vclie;dxPSPrVwRibbonRS17;dxSkinOffice2007PinkRS17;IcsFmxDXE3Run;cxPageControlRS17;dxSkinscxPCPainterRS17;AnyDAC_PhysADS_D17;AnyDAC_PhysIB_D17;dxmdsRS17;dxSkinTheAsphaltWorldRS17;DBXInformixDriver;Intraweb;dxPsPrVwAdvRS17;GLSS_FMOD;dxSkinSilverRS17;dxdborRS17;DBXFirebirdDriver;dsnapcon;inet;fsDB17;FFmpegFmx_DXE3;JvPascalInterpreter;vclx;dxSkinStardustRS17;cxEditorsRS17;DBXSybaseASADriver;crcontrols170;dbexpress;EurekaLogCore;IndyIPClient;JvBDE;AnyDAC_PhysMySQL_D17;cxTreeListdxBarPopupMenuRS17;dxSkinVS2010RS17;GLCg_RunTime;GLS_NGD;ZComponent;dxThemeRS17;DBXSqliteDriver;dxPScxGridLnkRS17;fmx;JvDlgs;IndySystem;TeeDB;dxSkinValentineRS17;inetdbbde;vclib;DataSnapClient;dxSkinDevExpressStyleRS17;FFmpegRtl_DXE3;DataSnapProviderClient;DBXSybaseASEDriver;cxBarEditItemRS17;AnyDAC_PhysMSAcc_D17;dxServerModeRS17;cxPivotGridOLAPRS17;cxSchedulerRS17;MetropolisUILiveTile;dxSkinPumpkinRS17;dxPSLnksRS17;AnyDAC_PhysSQLITE_D17;dxPSdxDBOCLnkRS17;cxVerticalGridRS17;dxSkinSpringTimeRS17;vcldsnap;GLS_Computing_RunTime;dacvcl170;dxSkinDevExpressDarkStyleRS17;DBXDb2Driver;AnyDAC_ComI_D17;DBXOracleDriver;dxSkinLiquidSkyRS17;JvCore;AnyDAC_PhysMSSQL_D17;vclribbon;AnyDAC_Comp_D17;cxSpreadSheetRS17;AnyDAC_PhysODBC_D17;fmxase;vcl;dxSkinOffice2007SilverRS17;AnyDAC_PhysPg_D17;CodeSiteExpressPkg;DBXMSSQLDriver;IndyIPCommon;dxPSdxOCLnkRS17;FFmpegVcl_DXE3;dcldxSkinsCoreRS17;JvAppFrm;AnyDAC_PhysASA_D17;inetdbxpress;webdsnap;IcsVclDXE3Run;dxSkinCoffeeRS17;AnyDAC_PhysOracle_D17;JvDocking;adortl;dxSkinscxSchedulerPainterRS17;JvWizards;frx17;JvHMI;dxtrmdRS17;dxPScxPCProdRS17;AnyDAC_GUIxForms_D17;JvBands;ZDbc;rtl;DbxClientDriver;dxTabbedMDIRS17;dxSkinSharpPlusRS17;dxComnRS17;ZPlain;dxSkinsCoreRS17;dxSkinLondonLiquidSkyRS17;dxdbtrRS17;JclContainers;Tee;JvSystem;dxorgcRS17;svnui;dxSkinBlackRS17;JvControls;IndyProtocols;DBXMySQLDriver;dxLayoutControlRS17;bindcompdbx;TeeUI;JvJans;JvPrintPreview;JvPageComps;JvStdCtrls;JvCustom;dxSkinOffice2007BlueRS17;dxPScxPivotGridLnkRS17;dxSpellCheckerRS17;ZCore;vcltouch;dxSkinOffice2007GreenRS17;dxSkinSharpRS17;websnap;dxSkinFoggyRS17;dxTileControlRS17;VclSmp;dxSkinDarkSideRS17;cxPivotGridRS17;DataSnapConnectors;AnyDAC_Phys_D17;dacfmx170;fmxobj;cxTreeListRS17;JclVcl;dxPSdxFCLnkRS17;dxSkinGlassOceansRS17;unidacvcl170;ZParseSql;frxe17;svn;dxFlowChartRS17;fmxdae;dxSkinsdxNavBarPainterRS17;bdertl;ExpertTools;DataSnapIndy10ServerTransport;dxDBXServerModeRS17;dxSkinCaramelRS17;$(DCC_UsePackage) + + + cxPivotGridChartRS17;dxSkinSevenRS17;dxSkinBlueprintRS17;dxSkinHighContrastRS17;dxSkinOffice2007BlackRS17;dxCoreRS17;cxPageControldxBarPopupMenuRS17;dxSkinXmas2008BlueRS17;dxPSDBTeeChartRS17;dxPSTeeChartRS17;dxSkinSummer2008RS17;dxPScxSchedulerLnkRS17;dxSkinBlueRS17;dxSkinDarkRoomRS17;DBXInterBaseDriver;DataSnapServer;DataSnapCommon;dxPScxTLLnkRS17;officeXPrt;dxRibbonRS17;DbxCommonDriver;cxDataRS17;vclimg;dxSkinsdxBarPainterRS17;dxPSdxDBTVLnkRS17;dbxcds;DatasnapConnectorsFreePascal;dxSkinMoneyTwinsRS17;vcldb;cxExportRS17;dxPSCoreRS17;dxBarExtItemsRS17;dxGDIPlusRS17;dxNavBarRS17;CustomIPTransport;cxLibraryRS17;cxGridRS17;dxSkinOffice2010BlackRS17;dsnap;IndyIPServer;IndyCore;dxSkinMcSkinRS17;CloudService;dxPScxCommonRS17;FmxTeeUI;dxSkinsdxDLPainterRS17;dxSkiniMaginaryRS17;AnyDAC_PhysDb2_D17;dxPScxVGridLnkRS17;dxSkinSevenClassicRS17;dxPScxExtCommonRS17;dxPScxSSLnkRS17;dxSkinLilianRS17;dxPSdxLCLnkRS17;dxSkinOffice2010BlueRS17;bindcompfmx;dxSkinOffice2010SilverRS17;cxSchedulerGridRS17;dbrtl;bindcomp;inetdb;dxBarRS17;IcsCommonDXE3Run;DBXOdbcDriver;dxBarDBNavRS17;dxSkinWhiteprintRS17;xmlrtl;dxSkinsdxRibbonPainterRS17;ibxpress;dxDockingRS17;bindengine;vclactnband;soaprtl;FMXTee;dxADOServerModeRS17;bindcompvcl;dxBarExtDBItemsRS17;vclie;dxPSPrVwRibbonRS17;dxSkinOffice2007PinkRS17;IcsFmxDXE3Run;cxPageControlRS17;dxSkinscxPCPainterRS17;AnyDAC_PhysADS_D17;AnyDAC_PhysIB_D17;dxmdsRS17;dxSkinTheAsphaltWorldRS17;DBXInformixDriver;Intraweb;dxPsPrVwAdvRS17;dxSkinSilverRS17;dxdborRS17;DBXFirebirdDriver;dsnapcon;inet;vclx;dxSkinStardustRS17;cxEditorsRS17;DBXSybaseASADriver;dbexpress;IndyIPClient;AnyDAC_PhysMySQL_D17;cxTreeListdxBarPopupMenuRS17;dxSkinVS2010RS17;ZComponent;dxThemeRS17;DBXSqliteDriver;dxPScxGridLnkRS17;fmx;IndySystem;TeeDB;dxSkinValentineRS17;vclib;DataSnapClient;dxSkinDevExpressStyleRS17;DataSnapProviderClient;DBXSybaseASEDriver;cxBarEditItemRS17;AnyDAC_PhysMSAcc_D17;dxServerModeRS17;cxPivotGridOLAPRS17;cxSchedulerRS17;MetropolisUILiveTile;dxSkinPumpkinRS17;dxPSLnksRS17;AnyDAC_PhysSQLITE_D17;dxPSdxDBOCLnkRS17;cxVerticalGridRS17;dxSkinSpringTimeRS17;vcldsnap;dxSkinDevExpressDarkStyleRS17;DBXDb2Driver;AnyDAC_ComI_D17;DBXOracleDriver;dxSkinLiquidSkyRS17;AnyDAC_PhysMSSQL_D17;vclribbon;AnyDAC_Comp_D17;cxSpreadSheetRS17;AnyDAC_PhysODBC_D17;fmxase;vcl;dxSkinOffice2007SilverRS17;AnyDAC_PhysPg_D17;DBXMSSQLDriver;IndyIPCommon;dxPSdxOCLnkRS17;dcldxSkinsCoreRS17;AnyDAC_PhysASA_D17;inetdbxpress;webdsnap;IcsVclDXE3Run;dxSkinCoffeeRS17;AnyDAC_PhysOracle_D17;adortl;dxSkinscxSchedulerPainterRS17;dxtrmdRS17;dxPScxPCProdRS17;AnyDAC_GUIxForms_D17;ZDbc;rtl;DbxClientDriver;dxTabbedMDIRS17;dxSkinSharpPlusRS17;dxComnRS17;ZPlain;dxSkinsCoreRS17;dxSkinLondonLiquidSkyRS17;dxdbtrRS17;Tee;dxorgcRS17;dxSkinBlackRS17;IndyProtocols;DBXMySQLDriver;dxLayoutControlRS17;bindcompdbx;TeeUI;dxSkinOffice2007BlueRS17;dxPScxPivotGridLnkRS17;dxSpellCheckerRS17;ZCore;vcltouch;dxSkinOffice2007GreenRS17;dxSkinSharpRS17;websnap;dxSkinFoggyRS17;dxTileControlRS17;VclSmp;dxSkinDarkSideRS17;cxPivotGridRS17;DataSnapConnectors;AnyDAC_Phys_D17;fmxobj;cxTreeListRS17;dxPSdxFCLnkRS17;dxSkinGlassOceansRS17;ZParseSql;dxFlowChartRS17;fmxdae;dxSkinsdxNavBarPainterRS17;DataSnapIndy10ServerTransport;dxDBXServerModeRS17;dxSkinCaramelRS17;$(DCC_UsePackage) + + + DEBUG;$(DCC_Define) + true + false + true + true + true + + + $(BDS)\bin\default_app.manifest + 1033 + true + false + + + false + RELEASE;$(DCC_Define) + 0 + false + + + $(BDS)\bin\default_app.manifest + + + + MainSource + + +
MainForm
+ dfm +
+ + Cfg_2 + Base + + + Base + + + Cfg_1 + Base + +
+ + Delphi.Personality.12 + + + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1049 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + + + + + + + + + VCLIPCameraCapture.dpr + + + + + True + False + + + 12 + + + +
diff --git a/samples/VCLDemo/vclIPCameraCapture/VCLIPCameraCapture.res b/samples/VCLDemo/vclIPCameraCapture/VCLIPCameraCapture.res new file mode 100644 index 0000000..c287ee9 Binary files /dev/null and b/samples/VCLDemo/vclIPCameraCapture/VCLIPCameraCapture.res differ diff --git a/samples/VCLDemo/vclIPCameraCapture/uMainForm.dfm b/samples/VCLDemo/vclIPCameraCapture/uMainForm.dfm new file mode 100644 index 0000000..88f6122 --- /dev/null +++ b/samples/VCLDemo/vclIPCameraCapture/uMainForm.dfm @@ -0,0 +1,122 @@ +object MainForm: TMainForm + Left = 0 + Top = 0 + BorderIcons = [biSystemMenu, biMinimize] + BorderStyle = bsSingle + Caption = 'IPCamera capture' + ClientHeight = 352 + ClientWidth = 471 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + OldCreateOrder = False + Position = poScreenCenter + OnDestroy = FormDestroy + PixelsPerInch = 96 + TextHeight = 13 + object img1: TImage + Left = 8 + Top = 52 + Width = 225 + Height = 181 + end + object pb1: TPaintBox + Left = 248 + Top = 52 + Width = 205 + Height = 181 + end + object Label1: TLabel + Left = 8 + Top = 8 + Width = 64 + Height = 13 + Caption = 'RTSP source:' + end + object lbl1: TLabel + Left = 200 + Top = 313 + Width = 13 + Height = 13 + Caption = 'ms' + end + object rb1: TRadioButton + Left = 8 + Top = 29 + Width = 113 + Height = 17 + Caption = 'Variant 1' + Checked = True + TabOrder = 0 + TabStop = True + end + object rb2: TRadioButton + Left = 248 + Top = 29 + Width = 113 + Height = 17 + Caption = 'Variant 2' + TabOrder = 1 + end + object chk1: TCheckBox + Left = 8 + Top = 240 + Width = 97 + Height = 17 + Caption = 'Draw text' + TabOrder = 2 + end + object rg1: TRadioGroup + Left = 8 + Top = 263 + Width = 445 + Height = 77 + Caption = ' Draw type ' + ItemIndex = 0 + Items.Strings = ( + 'On application idle' + 'On timer') + TabOrder = 3 + OnClick = rg1Click + end + object se1: TSpinEdit + Left = 96 + Top = 309 + Width = 98 + Height = 22 + Enabled = False + Increment = 100 + MaxValue = 10000 + MinValue = 1 + TabOrder = 4 + Value = 100 + OnChange = se1Change + end + object RTSPCapture: TEdit + Left = 78 + Top = 5 + Width = 294 + Height = 21 + TabOrder = 5 + Text = 'rtsp://192.168.1.10:554/11' + end + object ButtonStartCapture: TButton + Left = 378 + Top = 3 + Width = 75 + Height = 25 + Caption = 'Start' + TabOrder = 6 + OnClick = ButtonStartCaptureClick + end + object tmr1: TTimer + Enabled = False + Interval = 100 + OnTimer = tmr1Timer + Left = 352 + Top = 240 + end +end diff --git a/samples/VCLDemo/vclIPCameraCapture/uMainForm.pas b/samples/VCLDemo/vclIPCameraCapture/uMainForm.pas new file mode 100644 index 0000000..3d10972 --- /dev/null +++ b/samples/VCLDemo/vclIPCameraCapture/uMainForm.pas @@ -0,0 +1,172 @@ +(* / ************************************************************************************************** + // Project Delphi-OpenCV + // ************************************************************************************************** + // Contributor: + // laentir Valetov (laex@bk.ru) + // Mikhail Grigorev (sleuthound@gmail.com) + // ************************************************************************************************** + // You may retrieve the latest version of this file at the GitHub, + // located at git://github.com/Laex/Delphi-OpenCV.git + // ************************************************************************************************** + // License: + // The contents of this file are subject to the Mozilla Public License Version 1.1 (the "License"); + // you may not use this file except in compliance with the License. You may obtain a copy of the + // License at http://www.mozilla.org/MPL/ + // + // Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF + // ANY KIND, either express or implied. See the License for the specific language governing rights + // and limitations under the License. + // + // Alternatively, the contents of this file may be used under the terms of the + // GNU Lesser General Public License (the "LGPL License"), in which case the + // provisions of the LGPL License are applicable instead of those above. + // If you wish to allow use of your version of this file only under the terms + // of the LGPL License and not to allow others to use your version of this file + // under the MPL, indicate your decision by deleting the provisions above and + // replace them with the notice and other provisions required by the LGPL + // License. If you do not delete the provisions above, a recipient may use + // your version of this file under either the MPL or the LGPL License. + // + // For more information about the LGPL: http://www.gnu.org/copyleft/lesser.html + // ************************************************************************************************** + // Warning: Using Delphi XE3 syntax! + // ************************************************************************************************** + // The Initial Developer of the Original Code: + // OpenCV: open source computer vision library + // Homepage: http://opencv.org + // Online docs: http://docs.opencv.org + // Q&A forum: http://answers.opencv.org + // Dev zone: http://code.opencv.org + // ************************************************************************************************** *) + +unit uMainForm; + +interface + +uses + Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, + Vcl.Controls, Vcl.Forms, Vcl.Dialogs, + highgui_c, Vcl.ExtCtrls, Vcl.StdCtrls, Vcl.Samples.Spin; + +type + TMainForm = class(TForm) + img1: TImage; + rb1: TRadioButton; + pb1: TPaintBox; + rb2: TRadioButton; + chk1: TCheckBox; + rg1: TRadioGroup; + se1: TSpinEdit; + tmr1: TTimer; + Label1: TLabel; + RTSPCapture: TEdit; + ButtonStartCapture: TButton; + lbl1: TLabel; + procedure FormDestroy(Sender: TObject); + procedure rg1Click(Sender: TObject); + procedure se1Change(Sender: TObject); + procedure tmr1Timer(Sender: TObject); + procedure ButtonStartCaptureClick(Sender: TObject); + private + capture: pCvCapture; + framebitmap: TBitmap; + procedure OnIdle(Sender: TObject; var Done: Boolean); + procedure UpdateGetImage; + public + end; + +var + MainForm: TMainForm; + +implementation + +{$R *.dfm} + +Uses core.types_c, cvUtils; + +procedure TMainForm.ButtonStartCaptureClick(Sender: TObject); +var + rtsp: AnsiString; +begin + rtsp := AnsiString(RTSPCapture.Text); + capture := cvCreateFileCapture(pAnsiChar(rtsp)); + if Assigned(capture) then + begin + framebitmap := TBitmap.Create; + framebitmap.PixelFormat := pf24bit; + se1.Value := 100; + UpdateGetImage; + end; +end; + +procedure TMainForm.FormDestroy(Sender: TObject); +begin + if Assigned(capture) then + cvReleaseCapture(capture); + if Assigned(framebitmap) then + framebitmap.Free; +end; + +procedure TMainForm.OnIdle(Sender: TObject; var Done: Boolean); +Var + frame: pIplImage; +begin + frame := cvQueryFrame(capture); + if Assigned(frame) then + begin + IplImage2Bitmap(frame, framebitmap); + if rb1.Checked then + begin + if chk1.Checked then + framebitmap.Canvas.TextOut(2, 2, 'Text demo'); + img1.Picture.Assign(framebitmap); + end + else if rb2.Checked then + begin + pb1.Canvas.StretchDraw(pb1.ClientRect, framebitmap); + if chk1.Checked then + pb1.Canvas.TextOut(2, 2, 'Text demo'); + end; + Done := False; + end + else + Application.OnIdle := nil; +end; + +procedure TMainForm.rg1Click(Sender: TObject); +begin + UpdateGetImage; + se1.Enabled := rg1.ItemIndex = 1; + lbl1.Enabled := rg1.ItemIndex = 1; +end; + +procedure TMainForm.se1Change(Sender: TObject); +begin + tmr1.Interval := se1.Value; +end; + +procedure TMainForm.tmr1Timer(Sender: TObject); +var + Done: Boolean; +begin + OnIdle(nil, Done); +end; + +procedure TMainForm.UpdateGetImage; +begin + if Assigned(capture) then + case rg1.ItemIndex of + 0: + begin + tmr1.Enabled := False; + Application.OnIdle := OnIdle; + end; + 1: + begin + Application.OnIdle := Nil; + tmr1.Enabled := True; + end; + end; +end; + +end.