internal void GetOptions() { option.Blend = (float)Convert.ToDouble(slideBlend.Value); option.Opacity = (float)Convert.ToDouble(slideOpacity.Value); option.Pos = csSelect.CornetRegion; option.Enabled = chkEnabled.Checked; option.Tile = chkTile.Checked; option.Margin.X = (float)Convert.ToDouble(slideMarginX.Value); option.Margin.Y = (float)Convert.ToDouble(slideMarginY.Value); option.Offset.X = (float)Convert.ToDouble(slideOffsetX.Value); option.Offset.Y = (float)Convert.ToDouble(slideOffsetY.Value); option.Filters.Clear(); for (var i = 0; i < lvFilters.Items.Count; i++) { var filter = (IAddin)lvFilters.Items[i].Tag; option.Filters[filter.Name] = option.FilterParams[filter].Clone(); } option.Text = edText.Text; switch (tabObject.SelectedIndex) { case 0: mode = PinObjectMode.Picture; break; case 1: mode = PinObjectMode.Text; break; case 2: mode = PinObjectMode.Tag; break; } option.Mode = mode; }
/// <summary> /// /// </summary> /// <param name="image"></param> /// <returns></returns> public override Image Apply(Image image) { GetParams(fm); if (!(image is Image)) { return(image); } var st = DateTime.Now.Ticks; Bitmap dst = AddinUtils.CloneImage(image) as Bitmap; PinObjectMode PinObjectMode = (PinObjectMode)Params["PinObjectMode"].Value; bool objectOnly = (bool)Params["PinObjectOnly"].Value; PinOption option = (PinOption)Params["PinOption"].Value; switch (PinObjectMode) { case PinObjectMode.Picture: dst = DrawPicture(dst, option, objectOnly); break; case PinObjectMode.Text: dst = DrawText(dst, option, objectOnly); break; case PinObjectMode.Tag: break; } AddinUtils.CloneExif(image, dst); float tc = new TimeSpan(DateTime.Now.Ticks - st).Seconds + new TimeSpan(DateTime.Now.Ticks - st).Milliseconds / 1000f; Host.OnCommandPropertiesChange(new CommandPropertiesChangeEventArgs(AddinCommand.ApplyTiming, tc)); return(dst); }