func init // adds using namespace sys.add_use('System.Windows.Forms') sys.add_use('System.ComponentModel') sys.add_use('Emgu.CV') sys.add_use('Emgu.CV.UI') sys.add_use('Emgu.CV.Structure') // adds assembly sys.add_assembly('Emgu.CV', 'Emgu.CV.dll', 'assembly\\Emgu\\2.0.0\\') sys.add_assembly('Emgu.CV.UI', 'Emgu.CV.UI.dll', 'assembly\\Emgu\\2.0.0\\') sys.add_assembly('Emgu.Util', 'Emgu.Util.dll', 'assembly\\Emgu\\2.0.0\\') sys.file_copyto('' + code(packet_dir()) + 'assembly\\Emgu\\2.0.0\\cxcore110.dll', code(project_dir()) && 'cxcore110.dll') sys.file_copyto('' + code(packet_dir()) + 'assembly\\Emgu\\2.0.0\\highgui110.dll', code(project_dir()) && 'highgui110.dll') sys.file_copyto('' + code(packet_dir()) + 'assembly\\Emgu\\2.0.0\\cv110.dll', code(project_dir()) && 'cv110.dll') // initialize instance sys.add_widget('ImageBox') // initialize properties if(platform_target != 'x86') warning(this.name + ' - change property «Platform» to «x86»') end if(not isdef("FunctionalMode")) a = this.props("FunctionalMode").value flg = ((a _and_ 1) ? '|Emgu.CV.UI.ImageBox.FunctionalModeOption.Minimum' : '') + ((a _and_ 2) ? '|Emgu.CV.UI.ImageBox.FunctionalModeOption.RightClickMenu' : '') + ((a _and_ 4) ? '|Emgu.CV.UI.ImageBox.FunctionalModeOption.PanAndZoom' : '') + ((a _and_ 8) ? '|Emgu.CV.UI.ImageBox.FunctionalModeOption.Everything' : '') blk_init.println(this.codename, '.FunctionalMode = 0', flg, ';') end sys.set_undef_field_const('BorderStyle', this.props('BorderStyle'), 'System.Windows.Forms.BorderStyle') sys.set_typed_field(20, 'ErrorImage') sys.set_typed_field(20, 'DisplayedImage') sys.set_typed_field(20, 'Image') sys.set_undef_field('ImageLocation') sys.set_typed_field(20, 'InitialImage') sys.set_undef_field_const('SizeMode', this.props('SizeMode'), 'System.Windows.Forms.PictureBoxSizeMode') sys.set_typed_field(104, 'WaitOnLoad') // makes implementation methods for properties sys._prop_init('BorderStyle', 1, 1, 0) sys._prop_init('ErrorImage', 1, 1, 0) sys._prop_init('DisplayedImage', 1, 0, 0) sys._prop_init('.Image', 1, 1, 0) sys._prop_init('ImageLocation', 1, 1, 2) sys._prop_init('ImeMode', 1, 1, 0) sys._prop_init('InitialImage', 1, 1, 0) sys._prop_init('SizeMode', 1, 1, 0) sys._prop_init('WaitOnLoad', 1, 1, 104) // makes implementation of methods as properties sys._mtd_as_prop_init('ImageBox') // makes implementation of simple methods sys._method_init('CancelAsync') sys._method_init('Load') sys._method_init('LoadAsync') // initialize events sys.add_event_type('onLoadCompleted', 'LoadCompleted', 'AsyncCompletedEvent', 'args') sys.add_event_type('onLoadProgressChanged', 'LoadProgressChanged', 'ProgressChangedEvent', 'args') sys.add_event_type('onSizeModeChanged', 'SizeModeChanged', 'Event', 'args') // initialize common events and properties include("Control-init") end func doDisplayedImage(data) blk.println(this.codename, '.DisplayedImage = ', d("Image"), ';') end func doFunctionalMode(data) blk.println(this.codename, '.FunctionalMode = ', data, ';') end func doLoad2(url) blk.println(this.codename, '.Load(', d("url"), ');') end func doLoadAsync2(url) blk.println(this.codename, '.LoadAsync(', d("url"), ');') end include("Control")