コード例 #1
0
        public void SetOutputHandler(IOutputHandler outputHandler)
        {
            if (outputHandler != null)
            {
                //We need to store a ref in order to prevent garbage collection.
                WriteDataDelegate tmpWriteDataDelegate  = new WriteDataDelegate(WriteDataCallback);
                ImageDelegate     tmpBeginImageDelegate = new ImageDelegate(ImageCallback);

                IntPtr ptrWriteData  = Marshal.GetFunctionPointerForDelegate(tmpWriteDataDelegate);
                IntPtr ptrBeginImage = Marshal.GetFunctionPointerForDelegate(tmpBeginImageDelegate);


                nvttSetOutputOptionsOutputHandler(options, ptrWriteData, ptrBeginImage);

                writeDataDelegate  = tmpWriteDataDelegate;
                beginImageDelegate = tmpBeginImageDelegate;

                currentOutputHandler = outputHandler;
            }
            else
            {
                nvttSetOutputOptionsOutputHandler(options, IntPtr.Zero, IntPtr.Zero);

                writeDataDelegate  = null;
                beginImageDelegate = null;

                currentOutputHandler = null;
            }
        }
コード例 #2
0
 private static GridItemBase NewBarItem(object line, ImageDelegate image)
 {
     return(new GridVerticalArrayItem(
                new GridItemBase[] {
         new GridImageItem(line, image, HorizontalAlignment.Center, VerticalAlignment.Middle, false),
         new GridStringItem(line, HorizontalAlignment.Center, VerticalAlignment.Middle, false, false, QueryPanel.TextBrush, Program.DefaultFont)
     }, false));
 }
コード例 #3
0
ファイル: GridImageItem.cs プロジェクト: huizh/xenadmin
 private GridImageItem(Object rankObject, Image image, ImageDelegate imageDelegate, HorizontalAlignment hAlign, VerticalAlignment vAlign, bool clickSelectsRow, EventHandler onDoubleClickDelegate)
     : base(false, 1, clickSelectsRow, null, onDoubleClickDelegate)
 {
     this.rankObject = rankObject;
     this.imageDelegate = imageDelegate;
     this.image = image;
     this.vAlign = vAlign;
     this.hAlign = hAlign;
 }
コード例 #4
0
ファイル: GridImageItem.cs プロジェクト: wranders/xenadmin
 private GridImageItem(Object rankObject, Image image, ImageDelegate imageDelegate, HorizontalAlignment hAlign, VerticalAlignment vAlign, bool clickSelectsRow, EventHandler onDoubleClickDelegate)
     : base(false, 1, clickSelectsRow, null, onDoubleClickDelegate)
 {
     this.rankObject    = rankObject;
     this.imageDelegate = imageDelegate;
     this.image         = image;
     this.vAlign        = vAlign;
     this.hAlign        = hAlign;
 }
コード例 #5
0
        public PropertyGrouping(PropertyNames property, Grouping subgrouping)
            : base(subgrouping)
        {
            this.property         = property;
            this.propertyAccessor = PropertyAccessors.Get(property);

            this.i18n   = PropertyAccessors.PropertyNames_i18n[property];
            this.i18ns  = Invert((Dictionary <String, T>)PropertyAccessors.Geti18nFor(property));
            this.images = (ImageDelegate <T>)PropertyAccessors.GetImagesFor(property);
        }
コード例 #6
0
        public PropertyGrouping(XmlNode node)
            : base(node)
        {
            this.property         = (PropertyNames)Enum.Parse(typeof(PropertyNames), Helpers.GetXmlAttribute(node, "property"));
            this.propertyAccessor = PropertyAccessors.Get(property);

            this.i18n   = PropertyAccessors.PropertyNames_i18n[property];
            this.i18ns  = Invert((Dictionary <String, T>)PropertyAccessors.Geti18nFor(property));
            this.images = (ImageDelegate <T>)PropertyAccessors.GetImagesFor(property);
        }
コード例 #7
0
        /// <summary>
        /// The item at the end of ImageEdge.
        /// </summary>
        public ImageEdgeQuery node(ImageDelegate buildQuery)
        {
            Query.Append("node ");

            Query.Append("{");
            buildQuery(new ImageQuery(Query));
            Query.Append("}");

            return(this);
        }
コード例 #8
0
        ////////////////////////////////////////////////////////////////////////
        // Function name   : ViewModel
        // Description     : Constructor
        //                 :
        // Return type     :
        // Argument        : Frontend - Form Class
        ////////////////////////////////////////////////////////////////////////
        public ViewModel( Frontend fe)
        {
            // Get Form class as we need to update when data arrives
            frontend = fe ;

            // create the delegates for the callback functions
             md = new MRZDelegate(MRZCallback);
             id = new ImageDelegate(ImageCallback);

             Status = new DLL_STATUS();
        }
コード例 #9
0
        ////////////////////////////////////////////////////////////////////////
        // Function name   : ViewModel
        // Description     : Constructor
        //                 :
        // Return type     :
        // Argument        : Frontend - Form Class
        ////////////////////////////////////////////////////////////////////////
        public ViewModel(Frontend fe)
        {
            // Get Form class as we need to update when data arrives
            frontend = fe;

            // create the delegates for the callback functions
            md = new MRZDelegate(MRZCallback);
            id = new ImageDelegate(ImageCallback);

            Status = new DLL_STATUS();
        }
コード例 #10
0
 public static void SetImageToPicBox(PictureBox picBox, Image img)
 {
     if (picBox.InvokeRequired)
     {
         var d = new ImageDelegate(SetImageToPicBox);
         picBox.Invoke(d, new object[] { picBox, img });
     }
     else
     {
         picBox.Image = img;
     }
 }
        private void getImage()
        {
            // 実行するデリゲートを作成
            ImageDelegate imageDelegate =
                new ImageDelegate(this.DelegatingMethod);

            // コールバック関数
            AsyncCallback callback = new AsyncCallback(this.CallbackMethod);

            // 非同期実行の呼び出し
            IAsyncResult ar =
                imageDelegate.BeginInvoke(this.TripID, CurrentEcolog.Jst, callback, null);
        }
コード例 #12
0
        protected virtual void Dispose(bool disposing)
        {
            if (options != IntPtr.Zero)
            {
                nvttDestroyOutputOptions(options);

                options = IntPtr.Zero;
            }

            writeDataDelegate    = null;
            beginImageDelegate   = null;
            currentOutputHandler = null;
        }
コード例 #13
0
        /// <summary>
        /// The image associated with the article.
        /// </summary>
        /// <param name="maxWidth">
        /// Image width in pixels between 1 and 2048. This argument is deprecated: Use `maxWidth` on `Image.transformedSrc` instead.
        /// </param>
        /// <param name="maxHeight">
        /// Image height in pixels between 1 and 2048. This argument is deprecated: Use `maxHeight` on `Image.transformedSrc` instead.
        /// </param>
        /// <param name="crop">
        /// Crops the image according to the specified region. This argument is deprecated: Use `crop` on `Image.transformedSrc` instead.
        /// </param>
        /// <param name="scale">
        /// Image size multiplier for high-resolution retina displays. Must be between 1 and 3. This argument is deprecated: Use `scale` on `Image.transformedSrc` instead.
        /// </param>
        public ArticleQuery image(ImageDelegate buildQuery, long?maxWidth = null, long?maxHeight = null, CropRegion?crop = null, long?scale = null, string alias = null)
        {
            if (alias != null)
            {
                ValidationUtils.ValidateAlias(alias);

                Query.Append("image___");
                Query.Append(alias);
                Query.Append(":");
            }

            Query.Append("image ");

            Arguments args = new Arguments();

            if (maxWidth != null)
            {
                args.Add("maxWidth", maxWidth);
            }

            if (maxHeight != null)
            {
                args.Add("maxHeight", maxHeight);
            }

            if (crop != null)
            {
                args.Add("crop", crop);
            }

            if (scale != null)
            {
                args.Add("scale", scale);
            }

            Query.Append(args.ToString());

            Query.Append("{");
            buildQuery(new ImageQuery(Query));
            Query.Append("}");

            return(this);
        }
コード例 #14
0
ファイル: SearchFor.cs プロジェクト: ryu2048/xenadmin
        private void InitializeDictionaries()
        {
            // add all single types, names and images
            Dictionary <String, ObjectTypes> dict   = (Dictionary <String, ObjectTypes>)PropertyAccessors.Geti18nFor(PropertyNames.type);
            ImageDelegate <ObjectTypes>      images = (ImageDelegate <ObjectTypes>)PropertyAccessors.GetImagesFor(PropertyNames.type);

            foreach (KeyValuePair <String, ObjectTypes> kvp in dict)
            {
                typeNames[kvp.Value]  = kvp.Key;
                typeImages[kvp.Value] = Images.GetImage16For(images(kvp.Value));
            }

            // add all combo types, mostly names only
            typeNames[ObjectTypes.LocalSR | ObjectTypes.RemoteSR]  = Messages.ALL_SRS;
            typeImages[ObjectTypes.LocalSR | ObjectTypes.RemoteSR] = Images.GetImage16For(images(ObjectTypes.LocalSR | ObjectTypes.RemoteSR));
            typeNames[ObjectTypes.Server | ObjectTypes.DisconnectedServer | ObjectTypes.VM] = Messages.SERVERS_AND_VMS;
            typeNames[ObjectTypes.Server | ObjectTypes.DisconnectedServer | ObjectTypes.VM | ObjectTypes.UserTemplate | ObjectTypes.RemoteSR] = Messages.SERVERS_AND_VMS_AND_CUSTOM_TEMPLATES_AND_REMOTE_SRS;
            typeNames[ObjectTypes.Server | ObjectTypes.DisconnectedServer | ObjectTypes.VM | ObjectTypes.UserTemplate | ObjectTypes.RemoteSR | ObjectTypes.LocalSR] = Messages.SERVERS_AND_VMS_AND_CUSTOM_TEMPLATES_AND_ALL_SRS;
            typeNames[ObjectTypes.AllExcFolders] = Messages.ALL_TYPES;
            typeNames[ObjectTypes.AllIncFolders] = Messages.ALL_TYPES_AND_FOLDERS;
        }
        // コールバック関数:スレッド終了後の処理を記述
        private void CallbackMethod(IAsyncResult ar)
        {
            // AsyncResultに変換
            AsyncResult asyncResult = ar as AsyncResult;

            // 非同期の呼び出しが行われたデリゲート オブジェクトを取得
            ImageDelegate imageDelegate =
                asyncResult.AsyncDelegate as ImageDelegate;

            BitmapImage image = PhotographicImage.ByteToImageSource(imageDelegate.EndInvoke(ar).ImageSource);

            if (image == null)
            {
                image = new BitmapImage(
                    new Uri(String.Format("file://{0}Resources\\NoImage.png", AppDomain.CurrentDomain.BaseDirectory)));
                image.Freeze();
                CurrentImage = image;
            }
            else
            {
                CurrentImage = image;
            }
        }
コード例 #16
0
ファイル: GridImageItem.cs プロジェクト: huizh/xenadmin
 public GridImageItem(Object rankObject, ImageDelegate imageDelegate, HorizontalAlignment hAlign, VerticalAlignment vAlign, bool clickSelectsRow)
     : this(rankObject, null, imageDelegate, hAlign, vAlign, clickSelectsRow, null)
 {
 }
        private void getImage()
        {
            // 実行するデリゲートを作成
            ImageDelegate imageDelegate =
                new ImageDelegate(this.DelegatingMethod);

            // コールバック関数
            AsyncCallback callback = new AsyncCallback(this.CallbackMethod);

            // 非同期実行の呼び出し
            IAsyncResult ar =
                imageDelegate.BeginInvoke(this.TripID, CurrentEcolog.Jst, callback, null);
        }
コード例 #18
0
ファイル: GridImageItem.cs プロジェクト: huizh/xenadmin
 public GridImageItem(Object rankObject, ImageDelegate imageDelegate, HorizontalAlignment hAlign, VerticalAlignment vAlign, bool clickSelectsRow, EventHandler onDoubleClickDelegate)
     : this(rankObject, null, imageDelegate, hAlign, vAlign, clickSelectsRow, onDoubleClickDelegate)
 {
 }
コード例 #19
0
 private static extern Boolean voRegisterImageCallback(ImageDelegate Callback, ref UInt32 Parameter);
コード例 #20
0
ファイル: Recorder.cs プロジェクト: libeicun/Astrid.Video
        /// <summary>
        /// 采用默认设置构造一个记录仪。
        /// </summary>
        public Recorder(ImageDelegate onImgCaptured) {
            instanceCount++;
            if (instanceCount > MAX_INSTANCE_COUNT) {
                throw new ApplicationException("当前仅支持一个记录仪实例。");
            }


            if (DEFAULT_VIDEO_WIDTH % 4 != 0 || DEFAULT_VIDEO_HEIGHT % 4 != 0) {
                throw new Exception("视频长度及宽度必须均设置为4的倍数。");
            }


            timing = new TimingHelper();
            this.cameraCapturer = DEFAULT_CAMERA_CAPTURE;
            this.cameraCapturer.ImageCaptured += new CbGeneric<Bitmap>(this.OnImageCaptured1);
            this.microphoneCapturer = DEFAULT_MICROPHONE_CAPTURE;
            this.microphoneCapturer.AudioCaptured += OnAudioMixed;

            this.onImageCaptured = onImgCaptured;
        }
コード例 #21
0
ファイル: Columns.cs プロジェクト: BATYD-Turksat/xenadmin
 private static GridItemBase NewBarItem(object line, ImageDelegate image)
 {
     return new GridVerticalArrayItem(
         new GridItemBase[] {
                                new GridImageItem(line, image, HorizontalAlignment.Center, VerticalAlignment.Middle, false),
                                new GridStringItem(line, HorizontalAlignment.Center, VerticalAlignment.Middle, false, false, QueryPanel.TextBrush, Program.DefaultFont)
                            }, false);
 }
コード例 #22
0
ファイル: GridImageItem.cs プロジェクト: wranders/xenadmin
 public GridImageItem(Object rankObject, ImageDelegate imageDelegate, HorizontalAlignment hAlign, VerticalAlignment vAlign, bool clickSelectsRow)
     : this(rankObject, null, imageDelegate, hAlign, vAlign, clickSelectsRow, null)
 {
 }
コード例 #23
0
ファイル: GridImageItem.cs プロジェクト: wranders/xenadmin
 public GridImageItem(Object rankObject, ImageDelegate imageDelegate, HorizontalAlignment hAlign, VerticalAlignment vAlign, bool clickSelectsRow, EventHandler onDoubleClickDelegate)
     : this(rankObject, null, imageDelegate, hAlign, vAlign, clickSelectsRow, onDoubleClickDelegate)
 {
 }
コード例 #24
0
 private static extern Boolean voRegisterImageCallback(ImageDelegate Callback, ref UInt32 Parameter);