Arbruteblade
-
Posts
11 -
Joined
-
Last visited
Posts posted by Arbruteblade
-
-
I already have the gradient working, my problem is that it only writes to the top line of the picture and makes the rest black.
-
You don't need calculate the RGB value by hand, Paint.NET provides a HsvColor class to convert between colour spaces.
My method creates about 1530 colors, using Hsv only creates 360 colors.
-
I'm trying to make a plugin which makes a rainbow gradient going from left to right, the top line works well, but everything else becomes black, what do I do, or what am I missing about codelab or about Paint.NET? Will I have to make the rest of the plugin in a c# writing program? The version of paint.NET is 3.5.2.
Here's the code.
#region UICode int Amount1 = 0; // [0,5430] Offset #endregion byte nextred = 255; byte nextgreen = 0; byte nextblue = 0; int width = 0; int number = 0; void progress() { if (nextred == 255) { if (nextblue == 0 && nextgreen < 255) nextgreen++; if (nextblue > 0) nextblue--; } if (nextgreen == 255) { if (nextred == 0 && nextblue < 255) nextblue++; if (nextred > 0) nextred--; } if (nextblue == 255) { if (nextgreen == 0 && nextred < 255) nextred--; if (nextgreen > 0) nextgreen--; } } void Render(Surface dst, Surface src, Rectangle rect) { int offset = Amount1; ColorBgra[] GradientStore = new ColorBgra[5430]; while (offset > 0) { progress(); offset--; } while (number < 5430) { GradientStore[number].R = nextred; GradientStore[number].G = nextgreen; GradientStore[number].B = nextblue; progress(); number++; } ColorBgra CurrentPixel; int x = rect.Left; int y; while (x < rect.Right) { y = rect.Top; while (y < rect.Bottom) { CurrentPixel = GradientStore[x]; CurrentPixel.A = src[x,y].A; dst[x,y] = CurrentPixel; y++; } x++; } }
Also, am I in the right forum, any mods please move this if it isn't in the right forum.
-
One I made in a few minutes using mainly green and blue and being lazier with the circles, using a different plugin for the gradient, and other stuff like that.
I also made this one, it took me longer, and is my new desktop background, I chose not to put in any dots...
Hidden Content:The effect that can be made with this technique looks really good, well done.
-
While I wait for a reply, I want to say, I love this plugin, I can finally do basic algorithms without pixel-by-pixel edits, keep up the good work
-
What's the function(s)?
-
Thanks for the quick reply, too bad.
Anyways, that leads to Sarkut's question.
Could a plugin use RGBA values on one other layerif it is pre-loaded to the Windows clipboard?
I figure that is more likely, but...it all depends on how the program's clipboard is built (because codelab uses an include code for part of the code).
-
I'm sorry if this question has already been answered, but,
Can you read RGBA values on other layers? How?
-
Hi, I'm a total n00b and I'm having trouble getting a code to work right. Where do I go to ask someone what to do if I'm having trouble with a codelab code?
Also, is there a library of different functions in codelab?
Edit: nvm, most of the functions are in the source code.
Codelab Help for a n00b
in Plugin Developer's Central
Posted
I got it working, it overall taught me more about codelab's limitations, but I got it working by basing it slightly more on the template (CurrentPixel = src[x,y]), figuring out which variables should be global, etc.
I also managed to improve the algorithm while editing, and I also had to handle, "What if it goes out of the array?"