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; } }
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)); }
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; }
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); }
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); }
/// <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); }
//////////////////////////////////////////////////////////////////////// // 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(); }
//////////////////////////////////////////////////////////////////////// // 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(); }
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); }
protected virtual void Dispose(bool disposing) { if (options != IntPtr.Zero) { nvttDestroyOutputOptions(options); options = IntPtr.Zero; } writeDataDelegate = null; beginImageDelegate = null; currentOutputHandler = null; }
/// <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); }
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; } }
public GridImageItem(Object rankObject, ImageDelegate imageDelegate, HorizontalAlignment hAlign, VerticalAlignment vAlign, bool clickSelectsRow) : this(rankObject, null, imageDelegate, hAlign, vAlign, clickSelectsRow, null) { }
public GridImageItem(Object rankObject, ImageDelegate imageDelegate, HorizontalAlignment hAlign, VerticalAlignment vAlign, bool clickSelectsRow, EventHandler onDoubleClickDelegate) : this(rankObject, null, imageDelegate, hAlign, vAlign, clickSelectsRow, onDoubleClickDelegate) { }
private static extern Boolean voRegisterImageCallback(ImageDelegate Callback, ref UInt32 Parameter);
/// <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; }
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); }