BoltBait Posted February 17, 2018 Posted February 17, 2018 On 2/15/2018 at 12:51 PM, xod said: This is my Outlined text plugin. Is not working very well because of the approach. Seems to work pretty good to me. What issues are you seeing? Quote Download: BoltBait's Plugin Pack | CodeLab | and a Free Computer Dominos Game
MadJik Posted February 17, 2018 Posted February 17, 2018 Hi Some fonts show peaks I consider as a bug in the font not in the plugin. With ELI's sample I was thinking the outline was the square... no it's the font... What about adding the square for other fonts? or a circle? Or a variable gap between letters? Quote My DeviantArt | My Pictorium | My Plugins | Donate via Paypal
BoltBait Posted February 17, 2018 Posted February 17, 2018 28 minutes ago, MadJik said: Some fonts show peaks I consider as a bug in the font not in the plugin. That is easily fixed with a single line of code: outlinePen.LineJoin = LineJoin.Round; // Just add this line and those mitred line ends will be gone! path.AddString(text, myFont, (int)FontStyle.Regular, g.DpiY * txtSize / 72, new PointF(adrX, adrY), format); g.DrawPath(outlinePen, path); g.FillPath(myBrush, path); 1 2 Quote Download: BoltBait's Plugin Pack | CodeLab | and a Free Computer Dominos Game
xod Posted February 17, 2018 Author Posted February 17, 2018 (edited) Thanks BoltBait. Now you can increase the 'Outline size' to 100 or more without peek, as MadJik has noticed. But some fonts like Algerian will not even look like the original, (e.g. see D letter) but it's pretty good. Edited February 17, 2018 by xod Quote
xod Posted February 17, 2018 Author Posted February 17, 2018 (edited) In my previous plugin Histograms how can I update (in code) the controls to preserve previous values for a new run in another layer? I read this topic but I can't figure it out. https://forums.getpaint.net/topic/2248-visual-studio-2005-effect-plugin-template/ Edited February 17, 2018 by xod Quote
toe_head2001 Posted February 17, 2018 Posted February 17, 2018 You need to override InitDialogFromToken, and set UI control values from your Token. protected override void InitDialogFromToken(EffectConfigToken effectTokenCopy) { MyControl.Value = effectTokenCopy.MyAmount; } 1 Quote My Gallery | My Plugin Pack Layman's Guide to CodeLab
BoltBait Posted February 18, 2018 Posted February 18, 2018 I fixed the issue that MadJik found. Then, I extended the functionality to add gradient fills: // Name: Outlined / Gradient text // Submenu: Text Formations // Author: xod & BoltBait // Title: Outlined / Gradient text // Version: 1.0 // Desc: Draws outlined, gradient filled text // Keywords: text|gradient|outline // URL: #region UICode MultiLineTextboxControl Amount1 = "TEST"; // [1,32767] Text FontFamily Amount2 = new FontFamily("Arial"); // Font IntSliderControl Amount3 = 72; // [2,400] Font size IntSliderControl Amount4 = 8; // [0,100] Outline size ColorWheelControl Amount5 = ColorBgra.FromBgr(0,0,0); // [PrimaryColor] Outline color ColorWheelControl Amount6 = ColorBgra.FromBgr(255,255,255); // [SecondaryColor] Fill color ListBoxControl Amount7 = 0; // Fill Type|Solid Fill|Vertical Gradient|Horizontal Gradient|Diagonal Gradient|Reverse Diagonal Gradient ColorWheelControl Amount8 = ColorBgra.FromBgr(0,0,0); // [SecondaryColor] {!Amount7} Secondary Fill Color PanSliderControl Amount9 = Pair.Create(0.000,0.000); // Location #endregion void Render(Surface dst, Surface src, Rectangle rect) { Rectangle sel = EnvironmentParameters.GetSelection(src.Bounds).GetBoundsInt(); dst.CopySurface(src,rect.Location,rect); int adrX = (int)Math.Round((((Amount9.First + 1) / 2) * (sel.Right - sel.Left)) + sel.Left); int adrY = (int)Math.Round((((Amount9.Second + 1) / 2) * (sel.Bottom - sel.Top)) + sel.Top); String text = Amount1; if (text == "") text = " "; FontFamily font = Amount2; int txtSize = Amount3; Color fontColor = Amount6; int outlineSize = Amount4; Color outlineColor = Amount5; byte opacity = 255; Graphics g = new RenderArgs(dst).Graphics; g.SmoothingMode = SmoothingMode.AntiAlias; g.TextRenderingHint = TextRenderingHint.AntiAlias; StringFormat format = new StringFormat(); format.Alignment = StringAlignment.Center; format.LineAlignment = StringAlignment.Center; ColorBgra FillColor1 = Amount6; ColorBgra FillColor2 = Amount8; if (Amount7 == 0) FillColor2 = FillColor1; SizeF stringSize = new SizeF(); stringSize = g.MeasureString(text, new Font(Amount2, Amount3)); int GStartX = 0; int GStartY = 0; int GEndX = 1; int GEndY = 1; switch (Amount7) { case 1: GStartX = adrX; GEndX = adrX; GStartY = (int)(adrY - stringSize.Height / 2); GEndY = (int)(adrY + stringSize.Height / 2); break; case 2: GStartX = (int)(adrX - stringSize.Width / 2); GEndX = (int)(adrX + stringSize.Width / 2); GStartY = adrY; GEndY = adrY; break; case 3: GStartX = (int)(adrX - stringSize.Width / 2); GStartY = (int)(adrY - stringSize.Height / 2); GEndX = (int)(adrX + stringSize.Width / 2); GEndY = (int)(adrY + stringSize.Height / 2); break; case 4: GStartX = (int)(adrX + stringSize.Width / 2); GStartY = (int)(adrY - stringSize.Height / 2); GEndX = (int)(adrX - stringSize.Width / 2); GEndY = (int)(adrY + stringSize.Height / 2); break; default: break; } using (GraphicsPath path = new GraphicsPath()) using (Pen outlinePen = new Pen(Color.FromArgb(opacity, outlineColor), outlineSize)) using (LinearGradientBrush myGradientBrush = new LinearGradientBrush(new Point(GStartX,GStartY),new Point(GEndX,GEndY), FillColor1, FillColor2)) { g.Clip = new Region(rect); FontFamily myFont; try { myFont = new FontFamily(font.Name); } catch { myFont = new FontFamily("Arial"); } outlinePen.LineJoin = LineJoin.Round; path.AddString(text, myFont, (int)FontStyle.Regular, g.DpiY * txtSize / 72, new PointF(adrX, adrY), format); if (Amount4 > 0) { g.DrawPath(outlinePen, path); } g.FillPath(myGradientBrush, path); } g.Dispose(); } People are always searching for a way to outline text and also to draw gradient filled text. Now, they can get it from you. Enjoy. 2 3 Quote Download: BoltBait's Plugin Pack | CodeLab | and a Free Computer Dominos Game
Ego Eram Reputo Posted February 18, 2018 Posted February 18, 2018 3 hours ago, xod said: how can I update (in code) the controls to preserve previous values for a new run in another layer? Excerpt from a document MJW and I are occasionally working on.... Tokens & tokenization Quite simply, ‘tokens’ are the current value of each control in the plugin GUI. Each time a control is changed in the GUI, the value is updated (tokenization) and stored. These values are passed back and forth between the Dialog class and the Token class so they reflect the current state of the GUI controls. Tokenization provides the default values for the plugin when it opens. Tokenization also ensures changed values persists between instances of the plugin being opened in a single paint.net session. The Token class also supplies the values to the plugin’s Effect class, so the Effect class always has the latest values with which to render the effect. The orange lines in the previous diagram and the two following diagrams show the flow of Token values between classes for the different type of plugin. In IndirectUI plugins, tokenization is performed internally by paint.net, so the plugin author does not need to concern themselves with it. The more complex WinForm plugins require that the author make provision for Creating tokens Establishing the initial values of the tokens (the plugin defaults) Handling the flow of tokens between the Dialog, Token and Effect classes. 1 and 2 are done in your Effectconfigtoken.cs (or equivalent). First create the token // Example not using getters/setters: //---------------------------------------- // public double variable; public int storedTileSize; Then set the default value public EffectPluginConfigToken() : base() { // Set default variables here // this.variable = 0.0; this.storedTileSize = 32; } Finally add code to copy the token protected EffectPluginConfigToken(EffectPluginConfigToken copyMe) : base(copyMe) { // this.variable = copyMe.variable; this.storedTileSize = copyMe.storedTileSize; } That's the token construction taken care of. So, how is it used? In the EffectPluginConfigDialog.cs (or equivalent) there are two places tokens are used. First, this... protected override void InitialInitToken() { theEffectToken = new EffectPluginConfigToken(); } Then you can read the tokens in to create the setting(s) for the dialog protected override void InitDialogFromToken(EffectConfigToken effectToken) { EffectPluginConfigToken token = (EffectPluginConfigToken)effectToken; // restore last used Tile Size TileSize = token.storedTileSize; } ^^ assuming you've set up an int named TileSize Of course, you need a way to save the tokens from the dialog controls too..., protected override void InitTokenFromDialog() { EffectPluginConfigToken token = (EffectPluginConfigToken)theEffectToken; token.storedTileSize = (int)numericUpDown1.Value; } ^^ this sets the Tilesize token to the value of the numericupdown control Finally, you need to update the tokens (i.e. save a fresh set) when the OK button in your Effect is clicked. This happens when you call FinishTokenUpdate(), which is supplied by PDN (basically it fires InitTokenFromDialog()). private void buttonOK_Click(object sender, EventArgs e) { FinishTokenUpdate(); //DisposeImages(); if you have any DialogResult = DialogResult.OK; this.Close(); } 3 Quote ebook: Mastering Paint.NET | resources: Plugin Index | Stereogram Tut | proud supporter of Codelab plugins: EER's Plugin Pack | Planetoid | StickMan | WhichSymbol+ | Dr Scott's Markup Renderer | CSV Filetype | dwarf horde plugins: Plugin Browser | ShapeMaker
MadJik Posted February 18, 2018 Posted February 18, 2018 @BoltBait For vertical and horizontal gradient you need to affect GStart and GEnd also: int GStartX = 0; int GStartY = 0; int GEndX = 10; int GEndY = 10; switch (Amount7) { case 1: GStartX =adrX; GEndX = adrX; GStartY = (int)(adrY - stringSize.Height / 2); GEndY = (int)(adrY + stringSize.Height / 2); break; case 2: GStartX = (int)(adrX - stringSize.Width / 2); GEndX = (int)(adrX + stringSize.Width / 2); GStartY =adrY; GEndY = adrY; break; 1 Quote My DeviantArt | My Pictorium | My Plugins | Donate via Paypal
BoltBait Posted February 18, 2018 Posted February 18, 2018 18 minutes ago, MadJik said: For vertical and horizontal gradient you need to affect GStart and GEnd also: I suppose you're right. It doesn't matter what the values are, as long as they are the same. 1 Quote Download: BoltBait's Plugin Pack | CodeLab | and a Free Computer Dominos Game
xod Posted February 18, 2018 Author Posted February 18, 2018 Thank you very much both of you: BoltBait and MadJik who have shown interest in completing this plugin. Thanks to you it looks very professional now. Thank you toehead_2001 and special thanks for Ego Eram Reputo who gave me some very clear and detailed explanation about VS template. Quote
Eli Posted February 18, 2018 Posted February 18, 2018 12 hours ago, BoltBait said: People are always searching for a way to outline text and also to draw gradient filled text. Thanks xod and Boltbait. The gradient fills are great. Can other fills be added? Quote
xod Posted February 18, 2018 Author Posted February 18, 2018 (edited) Added new gradient facilities. Spoiler // Name: Outlined / Gradient text // Submenu: Text Formations // Author: xod & BoltBait // Title: Outlined / Gradient text // Version: 1.0 // Desc: Draws outlined, gradient filled text // Keywords: text|gradient|outline // URL: #region UICode MultiLineTextboxControl Amount1 = "TEST"; // [1,32767] Text FontFamily Amount2 = new FontFamily("Impact"); // Font IntSliderControl Amount3 = 140; // [2,400] Font size IntSliderControl Amount4 = 8; // [0,100] Outline size ColorWheelControl Amount5 = ColorBgra.FromBgr(0,0,255); // [Red] Outline color ColorWheelControl Amount6 = ColorBgra.FromBgr(139,0,0); // [DarkBlue] Fill color ListBoxControl Amount7 = 5; // Fill Type|Solid Fill|Vertical Gradient|Horizontal Gradient|Diagonal Gradient|Reverse Diagonal Gradient|Vertical Gradient Reflected|Horizontal Gradient Reflected ColorWheelControl Amount8 = ColorBgra.FromBgr(255,255,0); // [Cyan] {!Amount7} Secondary Fill Color DoubleSliderControl Amount9 = 0.5; // [0,1] {!Amount7} Start position DoubleSliderControl Amount10 = 1; // [0,1] {!Amount7} Intensity PanSliderControl Amount11 = Pair.Create(0.000,0.000); // Location #endregion void Render(Surface dst, Surface src, Rectangle rect) { Rectangle sel = EnvironmentParameters.GetSelection(src.Bounds).GetBoundsInt(); dst.CopySurface(src,rect.Location,rect); int adrX = (int)Math.Round(((Amount11.First + 1) / 2) * (sel.Right - sel.Left)); int adrY = (int)Math.Round(((Amount11.Second + 1) / 2) * (sel.Bottom - sel.Top)); String text = Amount1; FontFamily font = Amount2; int txtSize = Amount3; Color fontColor = Amount6; int outlineSize = Amount4; Color outlineColor = Amount5; byte opacity = 255; if (Amount4 == 0) opacity = 0; //no outline float startGradient = (float) Amount9; float intensity = (float) Amount10; Graphics g = new RenderArgs(dst).Graphics; g.SmoothingMode = SmoothingMode.AntiAlias; g.TextRenderingHint = TextRenderingHint.AntiAlias; StringFormat format = new StringFormat(); format.Alignment = StringAlignment.Center; format.LineAlignment = StringAlignment.Center; ColorBgra FillColor1 = Amount6; ColorBgra FillColor2 = Amount8; if (Amount7 == 0) FillColor2 = FillColor1; SizeF stringSize = new SizeF(); stringSize = g.MeasureString(text, new Font(Amount2, Amount3)); int GStartX = 0; int GStartY = 0; int GEndX = 1; int GEndY = 1; switch (Amount7) { case 1: GStartX = adrX; GEndX = adrX; GStartY = (int)(adrY - stringSize.Height / 2); GEndY = (int)(adrY + stringSize.Height / 2); break; case 2: GStartX = (int)(adrX - stringSize.Width / 2); GEndX = (int)(adrX + stringSize.Width / 2); GStartY = adrY; GEndY = adrY; break; case 3: GStartX = (int)(adrX - stringSize.Width / 2); GStartY = (int)(adrY - stringSize.Height / 2); GEndX = (int)(adrX + stringSize.Width / 2); GEndY = (int)(adrY + stringSize.Height / 2); break; case 4: GStartX = (int)(adrX + stringSize.Width / 2); GStartY = (int)(adrY - stringSize.Height / 2); GEndX = (int)(adrX - stringSize.Width / 2); GEndY = (int)(adrY + stringSize.Height / 2); break; case 5: GStartX = adrX; GEndX = adrX; GStartY = (int)(adrY - stringSize.Height / 2); GEndY = (int)(adrY + stringSize.Height / 2); break; case 6: GStartX = (int)(adrX - stringSize.Width / 2); GEndX = (int)(adrX + stringSize.Width / 2); GStartY = adrY; GEndY = adrY; break; default: break; } using (GraphicsPath path = new GraphicsPath()) using (Pen outlinePen = new Pen(Color.FromArgb(opacity, outlineColor), outlineSize)) using (LinearGradientBrush myGradientBrush = new LinearGradientBrush(new Point(GStartX,GStartY),new Point(GEndX,GEndY), FillColor1, FillColor2)) { if(Amount7 == 5|| Amount7 == 6) myGradientBrush.SetBlendTriangularShape(startGradient, intensity); g.Clip = new Region(rect); FontFamily myFont; try { myFont = new FontFamily(font.Name); } catch { myFont = new FontFamily("Arial"); } outlinePen.LineJoin = LineJoin.Round; path.AddString(text, myFont, (int)FontStyle.Regular, g.DpiY * txtSize / 72, new PointF(adrX, adrY), format); if (Amount4 > 0) { g.DrawPath(outlinePen, path); } g.FillPath(myGradientBrush, path); } g.Dispose(); } Edited February 18, 2018 by xod 1 Quote
AndrewDavid Posted February 18, 2018 Posted February 18, 2018 @xod Trouble after the build File: C:\Program Files\paint.net\Effects\OutlinedGradientText.dll Name: OutlinedGradientTextEffect.OutlinedGradientTextEffectPlugin Version: 1.0.6623.16135 Author: Copyright ©2018 by xod & BoltBait Copyright: Draws outlined, gradient filled text Website: http://www.getpaint.net/redirect/plugins.html Full error message: PaintDotNet.WorkerThreadException: Worker thread threw an exception ---> System.OutOfMemoryException: Out of memory. at System.Drawing.Drawing2D.LinearGradientBrush..ctor(Point point1, Point point2, Color color1, Color color2) at OutlinedGradientTextEffect.OutlinedGradientTextEffectPlugin.Render(Surface dst, Surface src, Rectangle rect) at OutlinedGradientTextEffect.OutlinedGradientTextEffectPlugin.OnRender(Rectangle[] rois, Int32 startIndex, Int32 length) at PaintDotNet.Effects.Effect`1.Render(EffectConfigToken parameters, RenderArgs dstArgs, RenderArgs srcArgs, Rectangle[] rois, Int32 startIndex, Int32 length) in D:\src\pdn\src\Effects\Effect`1.cs:line 98 at PaintDotNet.Effects.BackgroundEffectRenderer.RenderWithClipMask(Effect effect, EffectConfigToken token, RenderArgs dstArgs, RenderArgs srcArgs, Rectangle[] rois, IRenderer`1 clipMaskRenderer) in D:\src\pdn\src\PaintDotNet\Effects\BackgroundEffectRenderer.cs:line 170 at PaintDotNet.Effects.BackgroundEffectRenderer.RendererContext.RenderTile(EffectConfigToken token, Int32 tileIndex) in D:\src\pdn\src\PaintDotNet\Effects\BackgroundEffectRenderer.cs:line 150 at PaintDotNet.Effects.BackgroundEffectRenderer.RendererContext.RenderNextTile(EffectConfigToken token) in D:\src\pdn\src\PaintDotNet\Effects\BackgroundEffectRenderer.cs:line 142 at PaintDotNet.Effects.BackgroundEffectRenderer.ThreadFunction() in D:\src\pdn\src\PaintDotNet\Effects\BackgroundEffectRenderer.cs:line 239 --- End of inner exception stack trace --- at PaintDotNet.Effects.BackgroundEffectRenderer.DrainExceptions() in D:\src\pdn\src\PaintDotNet\Effects\BackgroundEffectRenderer.cs:line 418 at PaintDotNet.Effects.BackgroundEffectRenderer.Abort() in D:\src\pdn\src\PaintDotNet\Effects\BackgroundEffectRenderer.cs:line 374 at PaintDotNet.Effects.BackgroundEffectRenderer.Start() in D:\src\pdn\src\PaintDotNet\Effects\BackgroundEffectRenderer.cs:line 320 at PaintDotNet.Menus.EffectMenuBase.<>c__DisplayClass42_5.<RunEffectImpl>b__5() in D:\src\pdn\src\PaintDotNet\Menus\EffectMenuBase.cs:line 1032 Quote
xod Posted February 18, 2018 Author Posted February 18, 2018 Before the build press Ctrl+I and then hit Update button. Now build it again. Quote
AndrewDavid Posted February 18, 2018 Posted February 18, 2018 (edited) It works fine now. Now I'm curious about why that had to be done. The first time I have encountered that in over 20 builds. Something unique in your plugin I think. Edited February 18, 2018 by AndrewDavid Quote
xod Posted February 18, 2018 Author Posted February 18, 2018 Do you have the Impact font installed? Quote
Eli Posted February 18, 2018 Posted February 18, 2018 I have a little bug. The text is truncated when making a selection : Quote
BoltBait Posted February 18, 2018 Posted February 18, 2018 1 hour ago, Eli said: The text is truncated when making a selection I updated my code above to fix that problem. Quote Download: BoltBait's Plugin Pack | CodeLab | and a Free Computer Dominos Game
Eli Posted February 18, 2018 Posted February 18, 2018 40 minutes ago, BoltBait said: I updated my code above to fix that problem. Yes, it is working OK now. Thanks BoltBait. Quote
Djisves Posted February 19, 2018 Posted February 19, 2018 Given that: On 2/18/2018 at 3:39 AM, BoltBait said: ... People are always searching for a way to outline text and also to draw gradient filled text. Now, they can get it from you. and that: 14 hours ago, Eli said: Yes, it is working OK now. Thanks BoltBait. ... would it be too much to ask for a .dll to be released for the code-handicapped masses? 1 Quote
xod Posted February 19, 2018 Author Posted February 19, 2018 (edited) @Djisves the plugin is not finished yet. But if you want it in this state: OutlinedGradientText.zip When running the plugin, if you did not type any text and choose a gradient the plugin crashes. System.OutOfMemoryException: Out of memory. Edited February 19, 2018 by xod 1 Quote
BoltBait Posted February 19, 2018 Posted February 19, 2018 23 hours ago, xod said: if you did not type any text and choose a gradient the plugin crashes. I fixed mine. You can copy my fix to yours @xod then I think you're ready to publish. BTW, your code still has the problem Eli noticed (about selections). You can copy my fix for that as well. Here is the complete script with all bugs fixed: Spoiler // Name: Outlined / Gradient text // Submenu: Text Formations // Author: xod & BoltBait // Title: Outlined / Gradient text // Version: 1.0 // Desc: Draws outlined, gradient filled text // Keywords: text|gradient|outline // URL: #region UICode MultiLineTextboxControl Amount1 = "TEST"; // [1,32767] Text FontFamily Amount2 = new FontFamily("Arial"); // Font IntSliderControl Amount3 = 72; // [2,400] Font size IntSliderControl Amount4 = 8; // [0,100] Outline size ColorWheelControl Amount5 = ColorBgra.FromBgr(0,0,0); // [PrimaryColor] Outline color ColorWheelControl Amount6 = ColorBgra.FromBgr(255,255,255); // [SecondaryColor] Fill color ListBoxControl Amount7 = 0; // Fill Type|Solid Fill|Vertical Gradient|Horizontal Gradient|Diagonal Gradient|Reverse Diagonal Gradient ColorWheelControl Amount8 = ColorBgra.FromBgr(0,0,0); // [PrimaryColor] {!Amount7} Secondary Fill Color DoubleSliderControl Amount9 = 1.0; // [0,1] {!Amount7} Reflection point PanSliderControl Amount10 = Pair.Create(0.000,0.000); // Location #endregion void Render(Surface dst, Surface src, Rectangle rect) { Rectangle sel = EnvironmentParameters.GetSelection(src.Bounds).GetBoundsInt(); dst.CopySurface(src,rect.Location,rect); int adrX = (int)Math.Round((((Amount10.First + 1) / 2) * (sel.Right - sel.Left)) + sel.Left); int adrY = (int)Math.Round((((Amount10.Second + 1) / 2) * (sel.Bottom - sel.Top)) + sel.Top); String text = Amount1; if (text == "") text = " "; FontFamily font = Amount2; int txtSize = Amount3; Color fontColor = Amount6; int outlineSize = Amount4; Color outlineColor = Amount5; byte opacity = 255; Graphics g = new RenderArgs(dst).Graphics; g.SmoothingMode = SmoothingMode.AntiAlias; g.TextRenderingHint = TextRenderingHint.AntiAlias; StringFormat format = new StringFormat(); format.Alignment = StringAlignment.Center; format.LineAlignment = StringAlignment.Center; ColorBgra FillColor1 = Amount6; ColorBgra FillColor2 = Amount8; if (Amount7 == 0) FillColor2 = FillColor1; SizeF stringSize = new SizeF(); stringSize = g.MeasureString(text, new Font(Amount2, Amount3)); int GStartX = 0; int GStartY = 0; int GEndX = 1; int GEndY = 1; switch (Amount7) { case 1: GStartX = adrX; GEndX = adrX; GStartY = (int)(adrY - stringSize.Height / 2); GEndY = (int)(adrY + stringSize.Height / 2); break; case 2: GStartX = (int)(adrX - stringSize.Width / 2); GEndX = (int)(adrX + stringSize.Width / 2); GStartY = adrY; GEndY = adrY; break; case 3: GStartX = (int)(adrX - stringSize.Width / 2); GStartY = (int)(adrY - stringSize.Height / 2); GEndX = (int)(adrX + stringSize.Width / 2); GEndY = (int)(adrY + stringSize.Height / 2); break; case 4: GStartX = (int)(adrX + stringSize.Width / 2); GStartY = (int)(adrY - stringSize.Height / 2); GEndX = (int)(adrX - stringSize.Width / 2); GEndY = (int)(adrY + stringSize.Height / 2); break; default: break; } using (GraphicsPath path = new GraphicsPath()) using (Pen outlinePen = new Pen(Color.FromArgb(opacity, outlineColor), outlineSize)) using (LinearGradientBrush myGradientBrush = new LinearGradientBrush(new Point(GStartX,GStartY),new Point(GEndX,GEndY), FillColor1, FillColor2)) { myGradientBrush.SetBlendTriangularShape((float)Amount9, 1.0f); g.Clip = new Region(rect); FontFamily myFont; try { myFont = new FontFamily(font.Name); } catch { myFont = new FontFamily("Arial"); } outlinePen.LineJoin = LineJoin.Round; path.AddString(text, myFont, (int)FontStyle.Regular, g.DpiY * txtSize / 72, new PointF(adrX, adrY), format); if (Amount4 > 0) { g.DrawPath(outlinePen, path); } g.FillPath(myGradientBrush, path); } g.Dispose(); } Minus your Intensity slider, which really isn't necessary as the user can simply select different colors and get the same effect. I prefer a smaller UI whenever possible. Quote Download: BoltBait's Plugin Pack | CodeLab | and a Free Computer Dominos Game
AndrewDavid Posted February 19, 2018 Posted February 19, 2018 BTW @BoltBait This is how I spent my Sun Afternoon After you updated your code I tried to rebuild the DLL This is one of those "Hard to Believe" Issues. This is the error message I kept getting I know the file does not exist on the desktop. I am building it. I know the file is not in use - it hasn't been built yet. Even trying to build under a different name results in the same error message. There are no other reported errors in the dialogue box At first I thought it might be Codelab 3.4 so I removed it and re installed 3.3 This did not resolve the issue so I reinstalled 3.4 and still continue to get the error message. I uninstalled paint and reinstalled with codelab 3.3 - still got the same error message Renamed an older dll and it worked fine. Deleting the files and rebuilding still receives the error. Rebooting still receives the error. After building 30 plugins I thought I knew what I was doing. Just recently I was exporting a few to Visual Studio 2017 and recompiling them for the experience and everything was working fine. After trying to build this recent posted scipt from the forum - I consistently receive this error from Codelab. I find it hard to believe that it is only happening to me and has yet to be reported. I was quite reluctant to post this rant but thought you should know. Something very strange about this plugin. This was the first time I have ever used the Ctrl-I keystroke in Codelab. I was having the same problem with your other post about selecting and filling with color. After your update, I tried to rebuild, but all I got was this same error message. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.