sophie Posted June 22, 2016 Posted June 22, 2016 Hello and thank you for this program. I have an image size 8x4 centimeters and I need to make a grid for example 8x3 as in this image which I drew manually with the rectangle shapes tool and that is the reason why it's not perfect. My question is if there is a tool that will allow me to create grids as this one by just entering the number of cells or divisions I need horizontally and vertically and it will automatically adjust to the image size no matter the thickness of the lines. I have installed two tools called "gridlines" and "grid/checkerboard maker" and while they can draw grids they do not do what I need. Thanks. Quote
pdnnoob Posted June 22, 2016 Posted June 22, 2016 Try this plugin: http://forums.getpaint.net/index.php?showtopic=15476 Quote No, Paint.NET is not spyware...but, installing it is an IQ test. ~BoltBait Blend modes are like the filling in your sandwich. It's the filling that can change your experience of the sandwich. ~Ego Eram Reputo
sophie Posted June 23, 2016 Author Posted June 23, 2016 Thank you, I have tried the Graph Maker Plugin and it almost did what I needed. I found it easy to use by typing the number of divisions needed and the thickness of the desired lines. But I don't understand why the lines on the edges of the image are much thinner. They should have been as thick as the other blue lines. If I add a border like the red one, it would look OK but the size of the cells would no longer be the same. Maybe someone can give me an advice on how to increase the border lines so they would match the other ones while maintaining the size of the cells equal. Quote
toe_head2001 Posted June 23, 2016 Posted June 23, 2016 Looks like the outlining line is centered on the canvas edge; meaning half of it is hanging off the canvas. That should be pretty easy to solve. If I have time later tonight, I'll write a simple script for you. Quote My Gallery | My Plugin Pack Layman's Guide to CodeLab
toe_head2001 Posted June 24, 2016 Posted June 24, 2016 (edited) Here's the CodeLab script. Hidden Content: CodeLab // Name: Hor x Ver Cells // Submenu: Render // Author: toe_head2001 // Title: // Version: 0.9 // Desc: // Keywords: // URL: // Help: #region UICode IntSliderControl Amount1 = 5; // [2,100] Line Thickness IntSliderControl Amount2 = 8; // [1,100] Horizontal Cells IntSliderControl Amount3 = 3; // [1,100] Vertical Cells #endregion void Render(Surface dst, Surface src, Rectangle rect) { Rectangle selection = EnvironmentParameters.GetSelection(src.Bounds).GetBoundsInt(); float horLoops = Amount2; float verLoops = Amount3; float horCellSize = (selection.Width - Amount1) / horLoops; float verCellSize = (selection.Height - Amount1) / verLoops; dst.CopySurface(src, rect.Location, rect); using (RenderArgs ra = new RenderArgs(dst)) { Graphics plane = ra.Graphics; plane.Clip = new Region(rect); using (Pen planePen = new Pen(EnvironmentParameters.PrimaryColor, Amount1)) { for (int i = 1; i < horLoops; i++) { plane.DrawLine(planePen, selection.Left + horCellSize * i + Amount1 / 2f, selection.Top, selection.Left + horCellSize * i + Amount1 / 2f, selection.Bottom); } for (int i = 1; i < verLoops; i++) { plane.DrawLine(planePen, selection.Left, selection.Top + verCellSize * i + Amount1 / 2f, selection.Right, selection.Top + verCellSize * i + Amount1 / 2f); } planePen.Alignment = PenAlignment.Inset; plane.DrawRectangle(planePen, selection); } } } It works as you've described. Edited June 26, 2016 by toe_head2001 8 Quote My Gallery | My Plugin Pack Layman's Guide to CodeLab
sophie Posted June 24, 2016 Author Posted June 24, 2016 Thank you, but how do I place it in the effects folder? Quote
toe_head2001 Posted June 24, 2016 Posted June 24, 2016 On 6/24/2016 at 3:45 AM, sophie said: Thank you, but how do I place it in the effects folder? If you want it permanently in the Effects menu, CodeLab can create a dll file for you. Once you've created the dll file, place it in the effects folder just like any other plugin. http://boltbait.com/pdn/codelab/help/buildingdll.php If a script is short and simple, I like to keep it as script. Keeps the Effects menu tidy. But maybe that's just me. Create a dll if you like. I like my scripts folders with my nice collection. 1 Quote My Gallery | My Plugin Pack Layman's Guide to CodeLab
Eli Posted June 25, 2016 Posted June 25, 2016 Thanks for the tip toe_head, I managed to make the dll though I did not understood a single line of the script. Quote
Maximilian Posted June 26, 2016 Posted June 26, 2016 Thank you very much for the script, toe_head! Quote
sophie Posted June 26, 2016 Author Posted June 26, 2016 Ok, It is working. But I need more help again. I made first the blue grid 3x6 and now I need to fraction each cell into smaller grids (3x6 grids again) as the green one. However, when I select a cell and use the script I get the red ones. Could you make it work with selections as well? I hope I'm not asking too much and over-complicate the script. THANKS. Quote
toe_head2001 Posted June 26, 2016 Posted June 26, 2016 Ok, It is working. But I need more help again. I made first the blue grid 3x6 and now I need to fraction each cell into smaller grids (3x6 grids again) as the green one. However, when I select a cell and use the script I get the red ones. Could you make it work with selections as well? I hope I'm not asking too much and over-complicate the script. THANKS. It was supposed to work on selections, but I forget to test that. I've fixed it; it was a simple change. The updated script is in the original post. Quote My Gallery | My Plugin Pack Layman's Guide to CodeLab
sophie Posted June 30, 2016 Author Posted June 30, 2016 Thanks for the changes. A grid inside a selection is exactly what I needed. Quote
Welsh Yellow Cheddar Posted September 21, 2023 Posted September 21, 2023 On 6/24/2016 at 5:14 AM, toe_head2001 said: It works as you've described. http://kalama.x10host.com/gfx/junk/cells.png Edited June 26, 2016 by toe_head2001 Hello, @toe_head2001 Is this plugin published somewhere? I have to draw grids inside a selection and this plugin would become very handy. I wonder if it can draw dotted/dashed line as well? Thank you! Quote
BoltBait Posted September 21, 2023 Posted September 21, 2023 8 minutes ago, Welsh Yellow Cheddar said: Is this plugin published somewhere? I have to draw grids inside a selection and this plugin would become very handy. I wonder if it can draw dotted/dashed line as well? Thank you! The CodeLab script for the plugin is published above... Here's what to do with such a script: CodeLab for average users - A Layman's Guide - Miscellaneous - paint.net Forum (getpaint.net) Quote Download: BoltBait's Plugin Pack | CodeLab | and a Free Computer Dominos Game
BDP Posted September 21, 2023 Posted September 21, 2023 Hi, Using CodeLab v6.8, I get this error, which stops me from compiling as a DLL: 'EffectEnvironmentParameters.GetSelection(Rectangle)' is obsolete: 'There's no need to use this method. Use Selection.RenderRegionLegacy instead, or Selection.RenderBounds if you just need the bounding box.' Brian Quote
BoltBait Posted September 21, 2023 Posted September 21, 2023 16 minutes ago, BDP said: Using CodeLab v6.8, I get this error Yeah, that's an old script. Just find the following text in the script: EnvironmentParameters.GetSelection(src.Bounds).GetBoundsInt() change it to: EnvironmentParameters.SelectionBounds; 1 Quote Download: BoltBait's Plugin Pack | CodeLab | and a Free Computer Dominos Game
Welsh Yellow Cheddar Posted September 21, 2023 Posted September 21, 2023 Thanks @BoltBait, Is there a scrip that will draw dots or dashes instead of solid lines? (with adjustable distance between each dot or dash) 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.