Jump to content

BoltBait

Administrator
  • Posts

    15,634
  • Joined

  • Last visited

  • Days Won

    386

Posts posted by BoltBait

  1. 33 minutes ago, ReMake said:

    I got this crash for Bitmap Effect in CodeLab.

     

    You'll need to show us the script.

     

    It says:

     

    34 minutes ago, ReMake said:

    Exception details:
    System.ObjectDisposedException: Cannot access a disposed object.
    Object name: 'PaintDotNet.ComponentModel.ServiceProviderBase'.

     

    Oh, and BTW...

     

    34 minutes ago, ReMake said:

    paint.net 5.1 (α 5.100.8902.32650)

     

    We have not updated CodeLab for the new alpha build of Paint.NET.  We're waiting until it is closer to release... check back during the Beta phase.

  2. You can pretty much do the same (and more) than MSPaint by doing it this way:

     

    1. Choose the Rectangular Select tool :RectangleSelectTool:
    2. Press Ctrl + A to select the entire canvas
    3. Switch to the Move Selection tool :MoveSelectionTool: -- you now have handles on all 4 corners and centers of the edges
    4. Adjust the size of the selection by dragging by the handles (just like you do in MSPaint)
    5. When you have the desired shape selected, press the Crop button :ImageCrop:

    This is more flexible than MSPaint as you can adjust all 4 sides instead of only 2 and you can tinker with the selection until you get it just right before clicking the Crop button.

     

     

    • Like 1
    • Thanks 1
  3. 2 hours ago, Ambreville said:

    Is there a plan for improving Paint.Net's printer interface?

     

    Yes.

     

    However, it is WAAAAAAAAY down the features list.

     

    So, don't hold your breath waiting for that.

     

    (This is 2024, people don't print anymore.)

  4. Here is a classic script to help you determine when you are on the edge of a selection...

     

    Spoiler
    // Name:
    // Submenu:
    // Author:
    // Title:
    // Version:
    // Desc:
    // Keywords:
    // URL:
    // Help:
    #region UICode
    ReseedButtonControl Amount1 = 0; // Randomize
    #endregion
    
    // Here is the main multi-threaded render function
    // The dst canvas is broken up into rectangles and
    // your job is to write to each pixel of that rectangle
    void Render(Surface dst, Surface src, Rectangle rect)
    {
        // uint seed = RandomNumber.InitializeSeed(RandomNumberRenderSeed, rect.Location);
        // Delete this line if you don't need the selection outline shape
        PdnRegion selectionRegion = EnvironmentParameters.GetSelectionAsPdnRegion();
    
    
        // Step through each row of the current rectangle
        for (int y = rect.Top; y < rect.Bottom; y++)
        {
            if (IsCancelRequested) return;
            // Step through each pixel on the current row of the rectangle
            for (int x = rect.Left; x < rect.Right; x++)
            {
                ColorBgra SrcPixel = src[x,y];
                ColorBgra DstPixel = dst[x,y];
    
                ColorBgra CurrentPixel = SrcPixel;
    
                if ( (!selectionRegion.IsVisible(x-1,y)) || (!selectionRegion.IsVisible(x,y-1)) || (!selectionRegion.IsVisible(x+1,y)) || (!selectionRegion.IsVisible(x,y+1)) )
                {
                    // This pixel is next to the marching ants
    
                    // as an example, I'm changing that pixel to a random color
                    CurrentPixel = ColorBgra.FromBgr((byte)RandomNumber.Next(ref RandomNumberRenderSeed,255),(byte)RandomNumber.Next(ref RandomNumberRenderSeed,255),(byte)RandomNumber.Next(ref RandomNumberRenderSeed,255));
    
    
                }
                else
                {
                    // This pixel is NOT next to the marching ants
                }
                dst[x,y] = CurrentPixel;
            }
        }
    }
    

     

     

    So, select your building outline and run the script.

     

    Hope this helps.

    • You're a Smart Cookie! 1
×
×
  • Create New...