Eli Posted June 6, 2015 Share Posted June 6, 2015 Hello "Math Benders" There are several effects for Paint.net that can create lines, grids (with udjustable line thickness, hights and widths as well as colors) and patterns however they usually render the effect over the entire canvas. So when I need a grid I end up cropping the extra squares. CellMaker comes close to what I mean but it does not have udjustable line thickness nor it allows to determin the number of rows and columns needed. I wonder if a plugin could be created to render ONLY the cells needed with a possibility to udjust line thickness and color of the lines, the size of the cells as well as their number. Something like the tables that Word or Powerpoint create. Link to comment Share on other sites More sharing options...
xod Posted June 6, 2015 Share Posted June 6, 2015 You can make a selection and then run the plug-in that selection. http://forums.getpaint.net/index.php?/topic/4175-grid-maker-plugin/ Link to comment Share on other sites More sharing options...
Eli Posted June 6, 2015 Author Share Posted June 6, 2015 Thanks xod, But Grid /CheckerBoard Maker creates unwanted cells that have to be manually cropped. As I said above, CellMaker has an option to render the cells needed but does not allow other changes. It would be nice if I could have an option to enter the number of rows and columns I need, select the line thickness, and be able to adjusts the size of the cells. Link to comment Share on other sites More sharing options...
Red ochre Posted June 6, 2015 Share Posted June 6, 2015 they usually render the effect over the entire canvas I don't understand that bit Eli? - plugins can only render inside the selection they are 'given'. I just tried using grid maker inside a selection (as Xod suggested) and then using 'outline' selection - worked perfectly. Perhaps a grid maker that gave a choice for the number of cells vertically and horizontally within a selection would be useful ... or the cell dimensions in pixels rather than a fraction of the selection size? If you're certain grid maker will not do want you want, please try to describe exactly what you are looking for. Red ochre Plugin pack.............. Diabolical Drawings ................Real Paintings Link to comment Share on other sites More sharing options...
Eli Posted June 6, 2015 Author Share Posted June 6, 2015 Hello Red, I tried xod's suggestion as you can see in the picture above. I made a selection and then used the plugin Grid/Checkboard Maker. The generated grid inside the selection has cells (the ones in red) that I will have to crop. "Perhaps a grid maker that gave a choice for the number of cells vertically and horizontally within a selection would be useful ... or the cell dimensions in pixels rather than a fraction of the selection size?" These options you propose would be wonderful. Link to comment Share on other sites More sharing options...
Red ochre Posted June 6, 2015 Share Posted June 6, 2015 I'll see what I can do ... no promises! (I'm quite out of practice) Red ochre Plugin pack.............. Diabolical Drawings ................Real Paintings Link to comment Share on other sites More sharing options...
Eli Posted June 6, 2015 Author Share Posted June 6, 2015 Thanks!! Do not forget to add colors and different line styles would be nice too. Link to comment Share on other sites More sharing options...
Red ochre Posted June 6, 2015 Share Posted June 6, 2015 See post lower down. (I've slightly altered the code, adding a non AA'd option and messing around with the half line width I needed to add to make it all join up). .dll name = table,found under Effects/Renderdraws tablescompatible with Pdn3.5.11 (and Pdn4 + I hope haven't tested yet)Keywords - haven't added any yet! - may publish properly if any interest. Here's the codelab code: // Name: Table // Author: Red ochre (John Robbins) // Submenu: Render // URL: http://www.getpaint.net/redirect/plugins.html // Title: Table June 2015 Red ochre #region UICode int Amount1 = 50; // [5,1000] Cell width (pixels) int Amount2 = 10; // [1,100] Horizontal number of cells int Amount3 = 50; // [5,1000] Cell height (pixels) int Amount4 = 10; // [1,100] Vertical number of cells int Amount5 = 2; // [1,100] Pen width byte Amount6 = 0; // Line style|Solid|Dash|Dash-Dot|Dash-Dot-Dot|Dot ColorBgra Amount7 = ColorBgra.FromBgr(0,0,0); // Line colour #endregion void Render(Surface dst, Surface src, Rectangle rect) { // to avoid confusion H is Horizontal (not height) and V is vertical! dst.CopySurface(src, rect.Location, rect);// copy surface quicker than looping through int cellH = Amount1; int Hcellnum = Amount2; int cellV = Amount3; int Vcellnum = Amount4; float penW = Amount5; byte penstyle = (byte)(Amount6); ColorBgra pencol = Amount7; Rectangle sel = this.EnvironmentParameters.GetSelection(src.Bounds).GetBoundsInt(); float halfSelH = (sel.Right - sel.Left)/2; float halfSelV = (sel.Bottom - sel.Top)/2; //calculate table size from the amounts provided by user float Hrep = penW + cellH; float Vrep = penW + cellV; float TabH = penW + (Hrep * Hcellnum);float halfTabH = TabH/2; float TabV = penW + (Vrep * Vcellnum);float halfTabV = TabV/2; PointF topleft = new PointF((sel.Left + halfSelH)- halfTabH,(sel.Top + halfSelV) - halfTabV); using (Graphics graf = new RenderArgs(dst).Graphics)//the 'using' block means you don't need to 'Dispose' the graphics objects {graf.Clip = new Region(rect);graf.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias; using(Pen colpen = new Pen(pencol)) {colpen.Width = penW; switch(penstyle) {case 0:colpen.DashStyle = System.Drawing.Drawing2D.DashStyle.Solid; break; case 1:colpen.DashStyle = System.Drawing.Drawing2D.DashStyle.Dash; break; case 2:colpen.DashStyle = System.Drawing.Drawing2D.DashStyle.DashDot; break; case 3:colpen.DashStyle = System.Drawing.Drawing2D.DashStyle.DashDotDot; break; case 4:colpen.DashStyle = System.Drawing.Drawing2D.DashStyle.Dot; break; }//end switch block //horizontal lines for(int cnh = 0;cnh <= Vcellnum;cnh++) {PointF Hstart = new PointF(topleft.X - (penW/2),topleft.Y + (Vrep * cnh)); PointF Hend = new PointF((topleft.X + TabH) - (penW/2),topleft.Y + (Vrep * cnh)); graf.DrawLine(colpen, Hstart, Hend); } //vertical lines for(int cnv = 0;cnv <= Hcellnum;cnv++) {PointF Vstart = new PointF(topleft.X + (Hrep * cnv),topleft.Y - (penW/2)); PointF Vend = new PointF(topleft.X + (Hrep * cnv),(topleft.Y + TabV)- (penW/2)); graf.DrawLine(colpen, Vstart, Vend); } }//end pen using block }//end graf using block } 1 Red ochre Plugin pack.............. Diabolical Drawings ................Real Paintings Link to comment Share on other sites More sharing options...
Eli Posted June 6, 2015 Author Share Posted June 6, 2015 (edited) Already? I see your coding is not so rusty. THANKS!! It works with no problems on PDN 4. It is just what I wanted and I think you should publish it. It is different from Grid /CheckerBoard Make. Perhaps other users can contribute with suggestions. Postedit: The only issue I found is that the rendered lines are not fully solid: Edited June 6, 2015 by Eli Link to comment Share on other sites More sharing options...
Red ochre Posted June 6, 2015 Share Posted June 6, 2015 Not worth a rep Eli?! The codelab code is there - I'd really like to encourage you (and others) to use codelab.It is one of Pdn's great advantages over other graphics software.You're welcome to adapt that code as you like - perhaps create an overall size for height and width and divide by the number of columns and rows?Perhaps just adjust the range of values to suit your purpose, using codelab's U.I. designer?I'm not a programmer and have mostly learned via Boltbait's codelab tutorials and help from real developers on this forum.Give it a go! Red ochre Plugin pack.............. Diabolical Drawings ................Real Paintings Link to comment Share on other sites More sharing options...
Eli Posted June 6, 2015 Author Share Posted June 6, 2015 Sorry for the rep, I was testing it. When I look at scripts I get dizzy. 1 Link to comment Share on other sites More sharing options...
Popular Post Red ochre Posted June 7, 2015 Popular Post Share Posted June 7, 2015 Ta 4 rep! That's 'anti-aliasing' - try the new version, with AA turned off. it's now in my >>>>Plugin Pack<< It should automatically replace the previous version - but I'd delete that first to be sure, to be sure 10 Red ochre Plugin pack.............. Diabolical Drawings ................Real Paintings Link to comment Share on other sites More sharing options...
Ego Eram Reputo Posted June 7, 2015 Share Posted June 7, 2015 I'm not a programmer ... Nonsense. It's true you and I are probably not Senior NET Developers - but we're definitely programmers 1 ebook: Mastering Paint.NET | resources: Plugin Index | Stereogram Tut | proud supporter of Codelab plugins: EER's Plugin Pack | Planetoid | StickMan | WhichSymbol+ | Dr Scott's Markup Renderer | CSV Filetype | dwarf horde plugins: Plugin Browser | ShapeMaker Link to comment Share on other sites More sharing options...
Ego Eram Reputo Posted June 7, 2015 Share Posted June 7, 2015 Eli - if you know some HTML, you can write a simple table document and have my Markup Renderer render it to the canvas.was rendered with this HTML <!DOCTYPE html> <html> <head> <style> table { width:60%; } table, th, td { border: 1px solid black; border-collapse: collapse; } th, td { padding: 5px; text-align: left; } table#t01 tr:nth-child(even) { background-color: #eee; } table#t01 tr:nth-child(odd) { background-color:#fff; } table#t01 th { background-color: green; color: white; } </style> </head> <body> <table id="t01"> <tr> <th>First Name</th> <th>Last Name</th> <th>Points</th> </tr> <tr> <td>Jill</td> <td>Smith</td> <td>50</td> </tr> <tr> <td>Eve</td> <td>Jackson</td> <td>94</td> </tr> <tr> <td>John</td> <td>Doe</td> <td>80</td> </tr> </table> . </body> </html> 4 ebook: Mastering Paint.NET | resources: Plugin Index | Stereogram Tut | proud supporter of Codelab plugins: EER's Plugin Pack | Planetoid | StickMan | WhichSymbol+ | Dr Scott's Markup Renderer | CSV Filetype | dwarf horde plugins: Plugin Browser | ShapeMaker Link to comment Share on other sites More sharing options...
Eli Posted June 7, 2015 Author Share Posted June 7, 2015 I agree with you EER... You are great programmers! As for me... I am not a Senior Net Developer nor a programmer... but I am certainly a senior . Red, this is a little example of the effect: Thanks again! 6 Link to comment Share on other sites More sharing options...
Red ochre Posted June 7, 2015 Share Posted June 7, 2015 I've started having 'senior moments' if that counts. Glad you're finding it useful Eli and thanks for the image - my name (or avatar) in lights, I must be famous! Thanks for the compliment EER!I know more now than when I started, thanks to help from this forum! I think it is great that codelab can be used initially with minimal coding knowledge and is ideal for 'bespoke' plugins like this. 3 Red ochre Plugin pack.............. Diabolical Drawings ................Real Paintings Link to comment Share on other sites More sharing options...
Seerose Posted June 11, 2015 Share Posted June 11, 2015 (edited) @Red ochre! A big thank you for plugin and respect for the effort. I tried a different method. I hope you like it. And big thank you for ELi! Edited June 11, 2015 by Seerose 4 Live as if you were to die tomorrow. Learn as if you were to live forever. Gandhi Link to comment Share on other sites More sharing options...
Red ochre Posted June 11, 2015 Share Posted June 11, 2015 That's an imaginative use of the plugin Seerose! Good work! Red ochre Plugin pack.............. Diabolical Drawings ................Real Paintings Link to comment Share on other sites More sharing options...
Seerose Posted June 11, 2015 Share Posted June 11, 2015 That's an imaginative use of the plugin Seerose! Good work! @I Thank all of you. Live as if you were to die tomorrow. Learn as if you were to live forever. Gandhi Link to comment Share on other sites More sharing options...
Eli Posted June 11, 2015 Author Share Posted June 11, 2015 Seerose, your images are inspiring . 3 Link to comment Share on other sites More sharing options...
Seerose Posted June 13, 2015 Share Posted June 13, 2015 Seerose, your images are inspiring . @Dear Eli! I'm pleased. That's great. Thank you so much. Live as if you were to die tomorrow. Learn as if you were to live forever. Gandhi Link to comment Share on other sites More sharing options...
AgentGoodspeed Posted December 14, 2015 Share Posted December 14, 2015 Just discovered this. Totally fulfills my needs. Thanks! 1 Link to comment Share on other sites More sharing options...
pdnnoob Posted December 15, 2015 Share Posted December 15, 2015 Thread's getting a bit dusty. Glad you found what you needed! 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 Link to comment Share on other sites More sharing options...
Recommended Posts