BoltBait 3,235 Posted November 30, 2020 Report Share Posted November 30, 2020 BoltBait's Skew Plugin v1.0 Once installed, find Skew Horizontal and Skew Vertical in the Effects > Distort menu: Skew Vertical pretty much looks the same. Download: Until I add this to my latest plugin pack, you can download it here... Skew.zip To install this plugin, download skew.zip to your desktop, unzip all files to your desktop, and run the Install_Skew.bat file to install the Skew.dll file to your Paint.NET Effects directory. Source Code: Spoiler // Name: Skew Horizontal // Submenu: Distort // Author: BoltBait // Title: BoltBait's Skew - Horizontal v1.0 // Version: 1.0 // Desc: Skew selection // Keywords: skew // URL: https://BoltBait.com/pdn // Force Aliased Selection #region UICode IntSliderControl Amount1 = 0; // [-50,50] CheckboxControl Amount5 = true; // Fine Control CheckboxControl Amount4 = true; // Clamp to Selection CheckboxControl Amount2 = false; // Nearest Neighbor CheckboxControl Amount3 = false; // Wrapped #endregion Surface selectionSurface = null; void PreRender(Surface dst, Surface src) { // Thanks to toe_head2001 for this PreRender code // which is useful for clamping to selection Rectangle selection = this.EnvironmentParameters.SelectionBounds; if (selectionSurface == null || selectionSurface.Size != selection.Size) { selectionSurface?.Dispose(); selectionSurface = null; selectionSurface = new Surface(selection.Size); } selectionSurface.CopySurface(src, Point.Empty, selection); } void Render(Surface dst, Surface src, Rectangle rect) { int Step = Amount1; if (!Amount5) { Step *= 10; } Rectangle selection = EnvironmentParameters.SelectionBounds; float CenterY = ((selection.Bottom - selection.Top) / 2f) + selection.Top; for (int y = rect.Top; y < rect.Bottom; y++) { if (IsCancelRequested) return; float p = (CenterY - y) / (CenterY - selection.Top); for (int x = rect.Left; x < rect.Right; x++) { float XOffset = (-Step) * p; if (Amount3) { if (Amount2) { if (Amount4) { dst[x,y] = selectionSurface.GetBilinearSampleWrapped((int)(x+XOffset-selection.Left), y-selection.Top); } else { dst[x,y] = src.GetBilinearSampleWrapped((int)(x+XOffset), y); } } else { if (Amount4) { dst[x,y] = selectionSurface.GetBilinearSampleWrapped(x+XOffset-selection.Left, y-selection.Top); } else { dst[x,y] = src.GetBilinearSampleWrapped(x+XOffset, y); } } } else { if (Amount2) { if (Amount4) { dst[x,y] = selectionSurface.GetBilinearSampleClamped((int)(x+XOffset-selection.Left), y-selection.Top); } else { dst[x,y] = src.GetBilinearSampleClamped((int)(x+XOffset), y); } } else { if (Amount4) { dst[x,y] = selectionSurface.GetBilinearSampleClamped(x+XOffset-selection.Left, y-selection.Top); } else { dst[x,y] = src.GetBilinearSampleClamped(x+XOffset, y); } } } } } } Enjoy. 😎 3 2 Quote Click to play: Download: BoltBait's Plugin Pack | CodeLab | and how about a Computer Dominos Game Link to post Share on other sites
docmaster 0 Posted November 30, 2020 Report Share Posted November 30, 2020 Install_Skew.bat//прекрасно подошёл и открыл все ранее загруженные эффекты. Quote Link to post Share on other sites
ReMake 996 Posted November 30, 2020 Report Share Posted November 30, 2020 @docmaster, read the Forum Rules, please. In particular #22. And I believe that you are mistaken in claiming that Install_Skew.bat "opened all previously loaded effects". The same applies to your comment in the Water Reflection topic. @BoltBait sorry for off topic. Quote Link to post Share on other sites
docmaster 0 Posted November 30, 2020 Report Share Posted November 30, 2020 excuse my not literacy, it was about Mirror, which did not open immediately. And after downloading Skew v1.0 Quote Link to post Share on other sites
Djisves 534 Posted November 30, 2020 Report Share Posted November 30, 2020 Installed and working as expected. Thank you @BoltBait. 1 1 Quote Link to post Share on other sites
Scooter 289 Posted December 14, 2020 Report Share Posted December 14, 2020 BoltBait I Really like this. I don't understand it, but I do like the pretty skews and skew-ers and all. I have enclosed a mighty work of artistic doggerel, to show you. p.s. pay no attention to me, it is a great bit of program writer-ry an all. 1 Quote Scooter Age is only a number --in my case a Really BIG number, but there you have it When the prefect paint.net image is created, I will still be wondering "How they Do that?"- sigh☺️ Link to post Share on other sites
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.