Jump to content

BoltBait

Administrator
  • Posts

    15,728
  • Joined

  • Last visited

  • Days Won

    405

Everything posted by BoltBait

  1. Llew, you just gotta run your stuff up the flag pole and see who salutes.
  2. A properly done project is already underway: http://paintdotnet.12.forumer.com/viewtopic.php?t=4100 Please wait for it to be finished.
  3. I recommend you read this post: http://paintdotnet.12.forumer.com/viewtopic.php?t=3151 Did you receive redistribution permission from all the people that developed plugins? (That ^^ is a rhetorical question. I know you didn't get permission because I see a bunch of my plugins in there and you never got my permission.)
  4. It was hand drawn in pencil on copy machine paper. It looks like gray paper because I took a picture of the drawing instead of scanning it. Of course, I used Paint.NET to crop/resize/fix the photo.
  5. True: CodeLab == C# If a function exists in C# it exists in CodeLab. Unfortunatly, the functions you are looking for do not exist in C#. I'm not sure about saturation, however, you can access the HSV of a color by using the following function: public void EvanRGBtoHSV(int R, int G, int B, ref double outH, ref double outS, ref double outV) { const double HSV_UNDEFINED = -999.0; // R, G, and B must range from 0 to 255 // Ouput value ranges: // outH - 0.0 to 360.0 // outS - 0.0 to 1.0 // outV - 0.0 to 1.0 double dR = (double)R / 255.0; double dG = (double)G / 255.0; double dB = (double)B / 255.0; double dmaxRGB = EvanMax3(dR, dG, dB); double dminRGB = EvanMin3(dR, dG, dB); double delta = dmaxRGB - dminRGB; // Set value outV = dmaxRGB; // Handle special case if (dmaxRGB == 0) { outH = HSV_UNDEFINED; outS = 0.0; return; } outS = delta / dmaxRGB; if (dmaxRGB == dminRGB) { outH = HSV_UNDEFINED; return; } // Finally, compute hue if (dR == dmaxRGB) { outH = (dG - dB) / delta * 60.0; } else if (dG == dmaxRGB) { outH = (2.0 + (dB - dR) / delta) * 60.0; } else //if (dB == dmaxRGB) { outH = (4.0 + (dR - dG) / delta) * 60.0; } if (outH { outH += 360.0; } } public void EvanHSVtoRGB(double H, double S, double V, ref byte bR, ref byte bG, ref byte bB) { const double HSV_UNDEFINED = -999.0; // Parameters must satisfy the following ranges: // 0.0 // 0.0 // 0.0 // Handle special case first if (S == 0.0 || H == HSV_UNDEFINED) { byte x = (byte)(int)(V * 255.0); bR = x; bG = x; bB = x; return; } if (H >= 360.0) { H = AngleConstrain(H); } double R = V, G = V, B = V; double Hi = Math.Floor(H / 60.0); double f = H / 60.0 - Hi; double p = V * (1.0 - S); double q = V * (1.0 - f * S); double t = V * (1.0 - (1.0 - f) * S); if (Hi == 0.0) { R = V; G = t; B = p; } else if (Hi == 1.0) { R = q; G = V; B = p; } else if (Hi == 2.0) { R = p; G = V; B = t; } else if (Hi == 3.0) { R = p; G = q; B = V; } else if (Hi == 4.0) { R = t; G = p; B = V; } else if (Hi == 5.0) { R = V; G = p; B = q; } int iR = (int)(R * 255.0); int iG = (int)(G * 255.0); int iB = (int)(B * 255.0); bR = (byte)iR; bG = (byte)iG; bB = (byte)iB; } public double EvanMax3(double x, double y, double z) { return (x > y) ? ((x > z) ? x : z) : ((y > z) ? y : z); } public double EvanMin3(double x, double y, double z) { return (x } public double AngleConstrain(double MyAngle) { // Makes sure that 0.0 // "Wraps around" the value if it's outside this range if (MyAngle >= 360.0) { MyAngle -= Math.Floor(MyAngle / 360.0) * 360.0; } if (MyAngle { MyAngle += 360.0; } return MyAngle; }
  6. Aquafina. You couldn't guess from the name of the jpg?
  7. Here's one I did today: Too bad I didn't have time to finish it.
  8. Yes, you missed something significant. This isn't an effect--it is a file type plugin. Instead of putting the dll file in the Effects folder you need to put it in the File Types folder. To access it, you don't look under the Effects menu you see it as an option when you select File > Save As.
  9. Have you read the help file on how to use the recolor tool?
  10. Read this thread: http://paintdotnet.12.forumer.com/viewtopic.php?t=3254 and this one: http://paintdotnet.12.forumer.com/viewtopic.php?t=3258
  11. I already did. No you didn't, you rolled your own. Your attitude isn't helping anyone (especially considering this is my first publicly released plugin), and isn't exactly increasing my eagerness to make any new plugins. Sorry, I really didn't mean to step on your toes. Now that you've fixed your plugin it is clearly better than mine. Good job! (For me, it was easier to modify my own code than to try and find the bug in yours. I was hoping you would be able to compare my code to your own in order to find your issue.) That is explained here: http://paintdotnet.12.forumer.com/viewt ... 4136#24136 I recommend you go back and update your first post to let people know that it no longer has an issue with the preview mode. Again, let me say "Good Job!" I'm sorry that I didn't help you. Now that you do have a good handle on how to write effects, I hope you do write more. Since Rick does not accept code changes, this is the one area where people like you and I can contribute to making Paint.NET a better program. CodeLab only allows 1, 2, or 3 sliders OR a single direction control. These are the only built-in dialog boxes that CodeLab has access to. It would be WAAAYYY to complex to modify CodeLab to allow for other different dialog boxes that do not currently already exist in Paint.NET.
  12. FireFly, please remove my Plugins from your web site. http://one.fsphost.com/KingFireFly/plugins.html I know you say on your page that you are not the writer of the plugins, but without getting permission or crediting the original authors you are essentially pirating those effects. I'm glad you like my plugins, if you like you can always post a link to my plugin page: http://boltbait.googlepages.com Thanks, BoltBait P.S. Please read the announcement at the top of this forum: http://paintdotnet.12.forumer.com/viewtopic.php?t=3151
  13. Yes. But, if he wants to fix his instead, I'm fine with that.
  14. I already did. The codelab script I posted above does not have any issues.
  15. I'm not against the change. In fact, when I release my Dominoes 2.0 I'll be doing the same thing. Thanks for the idea. I just want you to make the decision based on the right information.
  16. Why not just make a slight change to the Grid plugin that I already wrote? Like this: int Amount1=5; //[2,25]Scanline Width int Amount2=0; //[0,1]Primary Color Secondary Color int Amount3=1; //[1,5]Brush Width void Render(Surface dst, Surface src, Rectangle rect) { // User Interface elements int GridSize = Amount1; bool SwapColors = (Amount2 == 1); // Other variables PdnRegion selectionRegion = EnvironmentParameters.GetSelection(src.Bounds); Rectangle selection = this.EnvironmentParameters.GetSelection(src.Bounds).GetBoundsInt(); ColorBgra CurrentPixel; ColorBgra PrimaryColor; ColorBgra SecondaryColor; bool Odd = false; // Get the current brush width for grids int w = Amount3; // Grab the primary and secondary colors (swapping if specified in the UI) if (SwapColors) { PrimaryColor = (ColorBgra)EnvironmentParameters.SecondaryColor; SecondaryColor = (ColorBgra)EnvironmentParameters.PrimaryColor; } else { PrimaryColor = (ColorBgra)EnvironmentParameters.PrimaryColor; SecondaryColor = (ColorBgra)EnvironmentParameters.SecondaryColor; } // Loop through all the pixels for(int y = rect.Top; y < rect.Bottom; y++) { for (int x = rect.Left; x < rect.Right; x++) { // Only work with a pixel if it is selected // (this handles convex & concave selections) if (selectionRegion.IsVisible(x, y)) { // Get the source pixel CurrentPixel = src[x,y]; Odd = false; for (int t=0; t<w; t++) { if (((y-t) % GridSize) == 0) Odd = true; } if ( Odd ) { CurrentPixel.R = (byte)PrimaryColor.R; CurrentPixel.G = (byte)PrimaryColor.G; CurrentPixel.B = (byte)PrimaryColor.B; CurrentPixel.A = (byte)PrimaryColor.A; } // Save the (modified?) pixel dst[x,y] = CurrentPixel; } } } } And, no preview issues.
  17. Just follow this tutorial: http://paintdotnet.12.forumer.com/viewtopic.php?t=3669 Then, at the end, click the menu Adjustments > Black and White. This will desaturate the "wings", that is, turn them white.
  18. The only thing I've ever looked up in the help file was how to use the Clone/Stamp tool. And, I looked it up in the online help file. Perhaps, you could have a link in the online help file that would allow a local copy to be installed?
×
×
  • Create New...