Jump to content

Unfinished plugins


xod

Recommended Posts

Thanks ReMake but I already have these lines of code:

Spoiler

 public class PluginSupportInfo : IPluginSupportInfo
    {
        public string Author => base.GetType().Assembly.GetCustomAttribute<AssemblyCopyrightAttribute>().Copyright;
        public string Copyright => LangStrings.EffectDescription;
        public string DisplayName => LangStrings.EffectName;
        public Version Version => base.GetType().Assembly.GetName().Version;
        public Uri WebsiteUri => new Uri("http://www.getpaint.net/redirect/plugins.html");
     }

 

 
 
 
 
 
29/5000
 
 
 
 
 
 
 
29/5
Link to comment
Share on other sites

6 hours ago, xod said:

... the title in the window that remains unchanged.

 

Is the title hardcoded in the plugin's constructor?

Example:

public RulerEffectPlugin()
  : base("My Plugin Title", null, null, EffectFlags.Configurable)
{
}

 

 

Does your plugin override OnCustomizeConfigUIWindowProperties?

Example:

protected override void OnCustomizeConfigUIWindowProperties(PropertyCollection props)
{
    props[ControlInfoPropertyNames.WindowTitle].Value = "My Plugin Title";
  
    base.OnCustomizeConfigUIWindowProperties(props);
}

 

  • Upvote 1

(September 25th, 2023)  Sorry about any broken images in my posts. I am aware of the issue.

bp-sig.png
My Gallery  |  My Plugin Pack

Layman's Guide to CodeLab

Link to comment
Share on other sites

Thanks again @toe_head2001. I don't know what I would do without your help.
I changed the folowing line and everything works fine now.

props[ControlInfoPropertyNames.WindowTitle].Value = "Test";

props[ControlInfoPropertyNames.WindowTitle].Value = LangStrings.EffectName;

 

Edited by xod
Link to comment
Share on other sites

  • 1 month later...

This plugin is a remake of the ImageInText plugin.
You need the OptionBasedLibrary v0.7.9 dll and dlc to be in the paint.net folder.

Location: Effects > Text Formations submenu.

 

The UI:

 

dXZo0DY.png

 

Download

Edited by xod
Replaced with a new version.
  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...

Very cool!

 

Lorem Ipsum is out of date - you need to use Zombie Ipsum! 🧟‍♂️

 

Zombie ipsum reversus ab viral inferno, nam rick grimes malum cerebro. De carne lumbering animata corpora quaeritis. Summus brains sit, morbo vel maleficia? De apocalypsi gorger omero undead survivor dictum mauris. Hi mindless mortuis soulless creaturas, imo evil stalking monstra adventus resi dentevil vultus comedat cerebella viventium. Qui animated corpse, cricket bat max brucks terribilem incessu zomby. The voodoo sacerdos flesh eater, suscitat mortuos comedere carnem virus. Zonbi tattered for solum oculi eorum defunctis go lum cerebro. Nescio brains an Undead zombies. Sicut malus putrid voodoo horror. Nigh tofth eliv ingdead. 🧟‍♀️

 

😀

 

Link to comment
Share on other sites

3 hours ago, Ego Eram Reputo said:

Very cool!

 

Lorem Ipsum is out of date - you need to use Zombie Ipsum! 🧟‍♂️

 

Zombie ipsum reversus ab viral inferno, nam rick grimes malum cerebro. De carne lumbering animata corpora quaeritis. Summus brains sit, morbo vel maleficia? De apocalypsi gorger omero undead survivor dictum mauris. Hi mindless mortuis soulless creaturas, imo evil stalking monstra adventus resi dentevil vultus comedat cerebella viventium. Qui animated corpse, cricket bat max brucks terribilem incessu zomby. The voodoo sacerdos flesh eater, suscitat mortuos comedere carnem virus. Zonbi tattered for solum oculi eorum defunctis go lum cerebro. Nescio brains an Undead zombies. Sicut malus putrid voodoo horror. Nigh tofth eliv ingdead. 🧟‍♀️

 

😀

 

 

That's bizarre and fantastic, although it looks like Daryl Dixon was editing Latin while having a sneezing fit. I love it!

 

  • Like 1

1496930299_DraconicSig.png.8e49d04e5ce393bdcdf9f0dfb54bf1c8.png

Link to comment
Share on other sites

  • 2 weeks later...

Also, a big thanks from me @xod   :star:  You are re-working a lot of older plugins and making them better!

Link to comment
Share on other sites

+1 👍

 

I like the link option for Height & Width. Any chance you could do the same for the four Radii?

Link to comment
Share on other sites

On 5/8/2017 at 1:30 PM, xod said:

In this place we would like to post unfinished plugins made with CodeLab but which could be a source of inspiration for beginners.
I'll start with a fun(?) plug-in that can be further developed by those who want to do it.

  Reveal hidden contents


        // Name: LongiStripes
        // Submenu: Render
        // Author: xod 
        // Title: LongiStripes
        // Version: 1.0
        // Desc: 
        // Keywords: 
        // URL: 
        // Help: 
        
        #region UICode
        DoubleSliderControl Amount1 = 0.75; // [0,1] Size
        IntSliderControl Amount2 = 100; // [0,400] Thickness
        ColorWheelControl Amount3 = ColorBgra.FromBgr(205,0,0); // [MediumBlue] Color
        DoubleSliderControl Amount4 = 0; // [0,1] Stripe1
        DoubleSliderControl Amount5 = 0.1; // [0,1] 
        DoubleSliderControl Amount6 = 0.3; // [0,1] Stripe2
        DoubleSliderControl Amount7 = 0.7; // [0,1] 
        DoubleSliderControl Amount8 = 0.9; // [0,1] Stripe3
        DoubleSliderControl Amount9 = 1; // [0,1] 
        DoubleSliderControl Amount10 = 1; // [0,1] X Distorsion
        DoubleSliderControl Amount11 = 1; // [0,1] Y Distorsion
        ListBoxControl Amount12 = 0; // Shapes|Ellipse|Rectangle|Triangle
        #endregion
        
        void Render(Surface dst, Surface src, Rectangle rect)
        {
           Rectangle selection = EnvironmentParameters.GetSelection(src.Bounds).GetBoundsInt();
           dst.CopySurface(src, rect.Location, rect);
           
            float centX = ((selection.Right - selection.Left) / 2f) + selection.Left;
            float centY = ((selection.Bottom - selection.Top) / 2f) + selection.Top;
            float size = (float)Amount1 * Math.Min(selection.Width - 4, selection.Height - 4);
            float half = size/2f;
            float sp1 = (float)Amount4;
            float sp2 = (float)Amount5;
            float sp3 = (float)Amount6;
            float sp4 = (float)Amount7;
            float sp5 = (float)Amount8;
            float sp6 = (float)Amount9;
            float xDis = (float) Amount10;
            float yDis = (float) Amount11;
            byte shapes = Amount12;
            
               using (RenderArgs ra = new RenderArgs(dst))
               { 
                Graphics g = ra.Graphics;
                g.SmoothingMode = SmoothingMode.AntiAlias;
                g.Clip = new Region(rect);
                 {
                  using (Pen penel = new Pen (Amount3, Amount2))
                  {
                    PointF[] points =
                    {
                    new PointF (centX-half*xDis, centY-half*yDis),
                    new PointF (size,centY-half*yDis),
                    new PointF (centX-half*xDis,size)
                    };
                    
                    if(sp1>=sp2){sp2=sp1;}
                    if(sp2>=sp3){sp3=sp2;}
                    if(sp3>=sp4){sp4=sp3;}
                    if(sp4>=sp5){sp5=sp4;}
                    if(sp5>=sp6){sp6=sp5;}
                    
                    penel.Width = Amount2;
                    penel.CompoundArray = new float[] {sp1, sp2, sp3, sp4, sp5, sp6};
           
           switch (shapes)
                   {
                    case 0: //ellipse          
                    {
                    g.DrawEllipse(penel, centX-half*xDis, centY-half*yDis, size*xDis, size*yDis);
                    }
                    break;
        
                    case 1: //rectangle
                    {
                    g.DrawRectangle(penel, centX-half*xDis, centY-half*yDis, size*xDis, size*yDis);
                    }
                    break;
                    
                    case 2: //triangle
                    {   
                    g.DrawPolygon(penel, points);
                    }
                    break;
                   }
                  }
                 }
               }
        }



 

 

LongiStripes.zip

Whatever it is, I bet it's gonna be very cool.

Link to comment
Share on other sites

6 hours ago, AndrewDavid said:

... your labels for gradient horizontal and vertical needs to be switched.

 

 

I don't understand what you mean.
A horizontal gradient means that we start with a color on the left and finish on the right with the other color (or vice versa = swap colors).
A vertical gradient means that we start with a color on the top and finish on the bottom with the other color (or vice versa = swap colors).
Same on the reflected case but now we start with the first color in the center of the shape and the second color appears at the edges (or vice versa = swap colors).

 

7 hours ago, Ego Eram Reputo said:

I like the link option for Height & Width. Any chance you could do the same for the four Radii?

 

For pairs 1-2, 3-4 is very simple, but for 3 corners or other combinations, I think the UI is unnecessarily complicated.
4 checkboxes must be created to enable the assigned sliders and a checkbox for their link.
I'm trying to keep the UI as small as possible.

Link to comment
Share on other sites

Maybe I need an education :)

Think of when you draw a vertical or horizontal line. In my mind I thought they were the same.

Here are the 2 gradients I create

image.png.a133f3308162727e5dd134936ee3b0b1.png

Back to art school 😁

PaintNetSignature.png.6bca4e07f5d738b2436f83d0ce1b876f.png

Link to comment
Share on other sites

8 hours ago, AndrewDavid said:

Maybe I need an education :)

Think of when you draw a vertical or horizontal line. In my mind I thought they were the same.

Here are the 2 gradients I create

image.png.a133f3308162727e5dd134936ee3b0b1.png

Back to art school 😁

 

Your "vertical" line has a "horizontal" gradient.

  • Like 1
Link to comment
Share on other sites

On 12/9/2018 at 11:24 PM, xod said:

For pairs 1-2, 3-4 is very simple, but for 3 corners or other combinations, I think the UI is unnecessarily complicated.
4 checkboxes must be created to enable the assigned sliders and a checkbox for their link.
I'm trying to keep the UI as small as possible.

 

One checkbox to link all four is what I'm after.

  • Like 1
Link to comment
Share on other sites

How can I dimmer two sliders?
I can do that but some flickering appear.
There is another way?

 

Spoiler

public enum PropertyNames
        {
            Slider1,
            Slider2,
            Slider3,
            KeepInSync
        }

        protected override PropertyCollection OnCreatePropertyCollection()
        {
            List<Property> props = new List<Property>();

            props.Add(new Int32Property("Slider1", 0,0,100));
            props.Add(new Int32Property("Slider2", 0,0,100));
            props.Add(new Int32Property("Slider3", 0,0,100));
            props.Add(new BooleanProperty("KeepInSync", false));

            List<PropertyCollectionRule> rules = new List<PropertyCollectionRule>();

            rules.Add(new LinkValuesBasedOnBooleanRule<int, Int32Property>(new string[] { "Slider1", "Slider2", "Slider3" }, "KeepInSync", false));
            rules.Add(new ReadOnlyBoundToBooleanRule("Slider2", "KeepInSync", false));
            rules.Add(new ReadOnlyBoundToBooleanRule("Slider3", "KeepInSync", false));

            return new PropertyCollection(props, rules);
        }

 

 

Link to comment
Share on other sites

In your code, the same condition (KeepInSync) causes the three sliders to be linked and two of them to be hidden, but these two sliders still remain connected.  While the sliders are linked, the hidden sliders will move and flicker all the same.

 

I have the same problem, but I haven't found a solution yet.

Link to comment
Share on other sites

My guess is that the property system wasn't designed with the idea of having controls linked, with some, but not all, hidden, so there may be no way around the flickering.

 

EDIT: From the video, everything looks fine. I don't see the flickering. Am I missing something, or is it something that isn't apparent in the video?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...