xod

Members
  • Content Count

    574
  • Joined

  • Last visited

  • Days Won

    14

Posts posted by xod


  1. It seems like I made a big mistake erasing the files in the Temp folder. Now I get other errors:

    The file 'C:\Users\username\AppData\Local\Temp\msivfglx.err' already exists.
    The file 'C:\Users\username\AppData\Local\Temp\msivfglx.out' already exists.
    Could not find file 'C:\Users\username\AppData\Local\Temp\0idvvdim.dll'.

    Unhandled Exception at line 0: 
    System.NullReferenceException: Object reference not set to an instance of an object.
       at PreviewEffectEffect.PreviewEffectEffectPlugin.OnSetRenderInfo(PropertyBasedEffectConfigToken newToken, RenderArgs dstArgs, RenderArgs srcArgs)
       at PaintDotNet.Effects.Effect`1.OnSetRenderInfo(EffectConfigToken parameters, RenderArgs dstArgs, RenderArgs srcArgs) in D:\src\pdn\src\Effects\Effect`1.cs:line 68
       at PaintDotNet.Effects.CodeLab.OnSetRenderInfo(EffectConfigToken parameters, RenderArgs dstArgs, RenderArgs srcArgs)
    Could not load file or assembly '0 bytes loaded from System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. An attempt was made to load a program with an incorrect format.

    I ran sfc / scannow and everything seems OK. All other programs run correctly except CodeLab.

     


  2. After I removed all files from Temp folder, when I open CodeLab I receive these error messages:

     

    Could not load file or assembly '0 bytes loaded from System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. An attempt was made to load a program with an incorrect format.

    Could not find file 'C:\Users\username\AppData\Local\Temp\ls0sg3ea.dll'.
    Could not find file 'C:\Users\username\AppData\Local\Temp\leb3m401.dll'.
    Could not find file 'C:\Users\username\AppData\Local\Temp\xuzqavj3.dll'.

     

    Paint.net works fine.


  3. Very nice plugin! Thanks.

     

    First crash: Enter some data and click on Tuesday.

     

    Exception details:
    System.ArgumentException: Object must be of type Double.
       at System.Double.CompareTo(Object value)
       at System.Windows.Forms.DataGridViewRowCollection.RowComparer.CompareObjects(Object value1, Object value2, Int32 rowIndex1, Int32 rowIndex2)
       at System.Windows.Forms.DataGridViewRowCollection.RowArrayList.Pivot(Int32 left, Int32 center, Int32 right)
       at System.Windows.Forms.DataGridViewRowCollection.RowArrayList.CustomQuickSort(Int32 left, Int32 right)
       at System.Windows.Forms.DataGridViewRowCollection.Sort(IComparer customComparer, Boolean ascending)
       at System.Windows.Forms.DataGridView.SortInternal(IComparer comparer, DataGridViewColumn dataGridViewColumn, ListSortDirection direction)
       at System.Windows.Forms.DataGridView.OnColumnHeaderMouseClick(DataGridViewCellMouseEventArgs e)
       at System.Windows.Forms.DataGridView.OnMouseClick(MouseEventArgs e)
       at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
       at System.Windows.Forms.Control.WndProc(Message& m)
       at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
     


  4. Another issue.

    Try to run this code:

    Spoiler
    
    // Name: test
    // Submenu:
    // Author: 
    // Title: test
    // Version: 
    // Desc:
    // Keywords:
    // URL:
    // Help:
    
    #region UICode
    PanSliderControl Amount1 = Pair.Create(1.000,1.000); // {Amount2} 
    CheckboxControl Amount2 = false; // [0,1] Enable
    #endregion
    
    void Render(Surface dst, Surface src, Rectangle rect)
    {
        
    }

    PDN crashes. It only works if parameters for Pair.Create is 0, 0 values: PairCreate(0.000, 0.000):

     


  5. Wrong alignment for braces when I try to format document because the statement is in line with 'if' keyword.

     

    Spoiler
    
    // Name: TextWarp
    // Submenu:
    // Author: xod
    // Title: TextWarp
    // Version: 1.0.0
    // Desc:
    // Keywords:
    // URL:
    // Help:
    
    #region UICode
    MultiLineTextboxControl Amount1 = "Text Warp"; // [1,32767]
    FontFamily Amount2 = new FontFamily("Arial"); // Font
    IntSliderControl Amount3 = 50; // [3,800] Font size
    PanSliderControl Amount4 = Pair.Create(-1.000,-1.000); //
    PanSliderControl Amount5 = Pair.Create(1.000,-1.000); //
    PanSliderControl Amount6 = Pair.Create(-1.000,1.000); //
    PanSliderControl Amount7 = Pair.Create(1.000,1.000); //
    IntSliderControl Amount8 = 0; // [0,360] Rotate
    CheckboxControl Amount9 = false; // [0,1] Shape
    #endregion
    
    void Render(Surface dst, Surface src, Rectangle rect)
    {
        Rectangle sel = EnvironmentParameters.GetSelection(src.Bounds).GetBoundsInt();
        Color PrimaryColor = EnvironmentParameters.PrimaryColor;
    
        float x1 = (float)Math.Round((Amount4.First + 1) * sel.Width / 2);
        float y1 = (float)Math.Round((Amount4.Second + 1) * sel.Height / 2);
    
        float x2 = (float)Math.Round((Amount5.First + 1) * sel.Width / 2);
        float y2 = (float)Math.Round((Amount5.Second + 1) * sel.Height / 2);
    
        float x3 = (float)Math.Round((Amount6.First + 1) * sel.Width / 2);
        float y3 = (float)Math.Round((Amount6.Second + 1) * sel.Height / 2);
    
        float x4 = (float)Math.Round((Amount7.First + 1) * sel.Width / 2);
        float y4 = (float)Math.Round((Amount7.Second + 1) * sel.Height / 2);
    
        string text = Amount1;
        int font_size = Amount3;
        FontStyle font_style = FontStyle.Regular;
    
        dst.CopySurface(src, rect.Location, rect);
    
        using (RenderArgs ra = new RenderArgs(dst))
        using (Pen pen = new Pen(PrimaryColor, 1))
        using (GraphicsPath path = new GraphicsPath())
        using (SolidBrush brush = new SolidBrush(PrimaryColor))
        using (FontFamily font_family = new FontFamily(Amount2.Name))
        using (Font font = new Font(font_family, font_size, font_style))
        using (StringFormat string_format = new StringFormat())
        {
            string_format.Alignment = StringAlignment.Near;
            string_format.LineAlignment = StringAlignment.Near;
            Graphics g = ra.Graphics;
            g.Clip = new Region(rect);
            g.SmoothingMode = SmoothingMode.AntiAlias;
            g.TextRenderingHint = TextRenderingHint.AntiAliasGridFit;
    
            // Create a rectangle.
            RectangleF srcRect = new RectangleF(0, 0, sel.Width, sel.Height);
    
            PointF p1 = new PointF(x1, y1);
            PointF p2 = new PointF(x2, y2);
            PointF p3 = new PointF(x3, y3);
            PointF p4 = new PointF(x4, y4);
    
            if(Amount9) path.AddRectangle(srcRect);
                path.AddString(text, font_family, (int)font_style, g.DpiY * font_size / 72, new PointF(0, 0), string_format);
    
            // Create a destination for the warped rectangle.
            PointF[] destPoints = {p1, p2, p3, p4};
    
            // Create a translation matrix.
            Matrix matrix = new Matrix();
            matrix.Translate(0, 0);
            if (Amount8 > 0)
            {
                // Move TopLeft corner to center of the canvas then rotate.
                matrix.Translate(sel.Width / 2, sel.Height / 2);
                matrix.Rotate(Amount8);
            }
    
            // Warp the source path.
            path.Warp(destPoints, srcRect, matrix, WarpMode.Perspective, 0.5f);
    
            // Draw the warped path to the screen.
            g.DrawPath(pen, path);
            if(!Amount9) g.FillPath(brush, path);
                }//Wrong alignment for braces when I try to format document
                 //because the statement is in line with 'if' keyword
        }

     

     


  6. Thank you for yours hard work !

     

    Very interesting behavior for Alt + Mouse click:

     

    1. Choose Paintbrush tool: size = 10 (or any other size)
    2. Press Alt key for locking the position of the brush
    3. Release Alt key and move the mouse anywhere on the canvas
    4. Left click to draw a straight line with the primary color or right click for secondary color

     

    This behavior also exists in the previous version.

    This is very useful for me. All I need now is a grid and Snap to grid option.