Jump to content
How to Install Plugins ×

CodeLab v6.12 for Paint.NET 5.0.12 (Updated February 11, 2024)


Recommended Posts

Hmmm... that gives me an interesting idea...

I wonder if a file type plugin could be written that would "open" a dll file by copying it to the effects folder.

This would allow someone to right-click on an effects dll and choose "open with Paint.net" to install the effect.

Then you'd be screwed if you set PdN as the default program for handling .dll's!

 

Take responsibility for your own intelligence. 😉 -Rick Brewster

Link to comment
Share on other sites

  • 2 weeks later...
What is the symbol you use at the end????

I don't understand your question. Could you be more specific?

The "end" of what, exactly? What error are you seeing?

type or namespace definition, or end of file expected (CS1002)

Do you know what this is?

sig.png

Broken toaster =

(Rushes to HomeBase!)

Link to comment
Share on other sites

What is the symbol you use at the end????

I don't understand your question. Could you be more specific?

The "end" of what, exactly? What error are you seeing?

type or namespace definition, or end of file expected (CS1002)

Do you know what this is?

Show me your code.

Link to comment
Share on other sites

void Render(Surface dst, Surface src, Rectangle rect)
{ // How big is your box of chalk?
double BaseColors = 72; // 1-360, step 1, Default = 72

PdnRegion selectionRegion = EnvironmentParameters.GetSelection(src.Bounds);
Rectangle selection = this.EnvironmentParameters.GetSelection(src.Bounds).GetBoundsInt();
ColorBgra CurrentPixel;
double Q = 360 / BaseColors;
double H = 0,S = 0,V = 0;
for(int y = rect.Top; y < rect.Bottom; y++)
{
	for (int x = rect.Left; x < rect.Right; x++)
	(
		if (selectionRegion.IsVisible(x, y))

			CurrentPixel = src[x,y];
			; (CurrentPixel.R,CurrentPixel.G,CurrentPixel.B,ref H,ref) S,ref V); (CS1026)
			H = Q*(double)Math.Round(H/Q); // Normalize Hue
			if (S > .15) // Compress Saturation
			(
				S = ( (0.35*(S-0.15)) / (1.0-0.15) ) + 0.15;
			)
			if (V > 0.05) // Compress Value
			(
				V = ( (0.15*(V-0.05)) / (1.0-0.05) ) + 0.85;
			) ;

			else // Near Black Pixels
			{
				S = 0; // turn them gray
				V += 0.75;
			}
			EvanHSVtoRGB(H,S,V,ref CurrentPixel.R,ref CurrentPixel.G,ref CurrentPixel.;
			dst[x,y] = CurrentPixel;
		}
	}
}
}

sig.png

Broken toaster =

(Rushes to HomeBase!)

Link to comment
Share on other sites

void Render{Surface dst, Surface src, Rectangle rect}

{ // How big is your box of chalk?

double BaseColors = 72; // 1-360, step 1, Default = 72

PdnRegion selectionRegion = EnvironmentParameters.GetSelection{src.Bounds};

Rectangle selection = this.EnvironmentParameters.GetSelection{src.Bounds}.GetBoundsInt{};

ColorBgra CurrentPixel;

double Q = 360 / BaseColors;

double H = 0,S = 0,V = 0;

for(int y = rect.Top; y < rect.Bottom; y++}

{

for {int x = rect.Left; x < rect.Right; x++}

{

if {selectionRegion.IsVisible{x, y}}

CurrentPixel = src[x,y];

; {CurrentPixel.R,CurrentPixel.G,CurrentPixel.B,ref H,ref} S,ref V}; {CS1026}

H = Q*{double}Math.Round{H/Q}; // Normalize Hue

if {S > .15} // Compress Saturation

{

S = { {0.35*{S-0.15}} / {1.0-0.15} } + 0.15;

}

{V > 0.05} // Compress Value

{

V = { {0.15*{V-0.05}} / {1.0-0.05} } + 0.85;

} ;

else // Near Black Pixels

{

S = 0; // turn them gray

V += 0.75;

}

EvanHSVtoRGB(H,S,V,ref CurrentPixel.R,ref CurrentPixel.G,ref CurrentPixel.B};

dst[x,y] = CurrentPixel;

}

}

}

}

Just made more errors :sad:

Can you correct all the errors then send back to me?

sig.png

Broken toaster =

(Rushes to HomeBase!)

Link to comment
Share on other sites

Code without error message BUT still not working due to bad programing:

int Amount1=72; //[1,360]How big is your box of chalk?

void Render(Surface dst, Surface src, Rectangle rect)
{ 
 double BaseColors = (double)Amount1; 

 PdnRegion selectionRegion = EnvironmentParameters.GetSelection(src.Bounds); 
 Rectangle selection = this.EnvironmentParameters.GetSelection(src.Bounds).GetBoundsInt(); 
 ColorBgra CurrentPixel; 
 double Q = 360 / BaseColors; 
 double H = 0,S = 0,V = 0; 
 for(int y = rect.Top; y < rect.Bottom; y++) 
 { 
   for (int x = rect.Left; x < rect.Right; x++) 
   { 
     if (selectionRegion.IsVisible(x, y))
     { 
       CurrentPixel = src[x,y]; 
       H = Q * (double)Math.Round(H / Q); // Normalize Hue 

       if (S > 0.15) // Compress Saturation 
       { 
         S = ((0.35 * (S - 0.15)) / (1.0 - 0.15)) + 0.15; 
       } 

       if (V > 0.05) // Compress Value 
       { 
         V = ((0.15 * (V - 0.05)) / (1.0 - 0.05)) + 0.85; 
       } 
       else // Near Black Pixels 
       { 
         S = 0; // turn them gray 
         V += 0.75; 
       } 
       //EvanHSVtoRGB(H,S,V,ref CurrentPixel.R,ref CurrentPixel.G,ref CurrentPixel.; 
       dst[x,y] = CurrentPixel; 
     } 
   } 
 } 
} 

1. Never use {} for function, it's only needed for groups of instructions.

2. Use () for all the functions.

3. Semi-column ';' is needed at the end of an instruction

4. S, V are always at 0! You need to affect them a value somewhere!

5. EvanHSVtoRGB isn't a built-in function, to use it, you have to add its code at the end.

6. I have added Amount1, that will allow you to have a slider when you will build the DLL.

Now please go on...

Link to comment
Share on other sites

Code without error message BUT still not working due to bad programing:

int Amount1=72; //[1,360]How big is your box of chalk?

void Render(Surface dst, Surface src, Rectangle rect)
{ 
 double BaseColors = (double)Amount1; 

 PdnRegion selectionRegion = EnvironmentParameters.GetSelection(src.Bounds); 
 Rectangle selection = this.EnvironmentParameters.GetSelection(src.Bounds).GetBoundsInt(); 
 ColorBgra CurrentPixel; 
 double Q = 360 / BaseColors; 
 double H = 0,S = 0,V = 0; 
 for(int y = rect.Top; y < rect.Bottom; y++) 
 { 
   for (int x = rect.Left; x < rect.Right; x++) 
   { 
     if (selectionRegion.IsVisible(x, y))
     { 
       CurrentPixel = src[x,y]; 
       H = Q * (double)Math.Round(H / Q); // Normalize Hue 

       if (S > 0.15) // Compress Saturation 
       { 
         S = ((0.35 * (S - 0.15)) / (1.0 - 0.15)) + 0.15; 
       } 

       if (V > 0.05) // Compress Value 
       { 
         V = ((0.15 * (V - 0.05)) / (1.0 - 0.05)) + 0.85; 
       } 
       else // Near Black Pixels 
       { 
         S = 0; // turn them gray 
         V += 0.75; 
       } 
       //EvanHSVtoRGB(H,S,V,ref CurrentPixel.R,ref CurrentPixel.G,ref CurrentPixel.; 
       dst[x,y] = CurrentPixel; 
     } 
   } 
 } 
} 

1. Never use {} for function, it's only needed for groups of instructions.

2. Use () for all the functions.

3. Semi-column ';' is needed at the end of an instruction

4. S, V are always at 0! You need to affect them a value somewhere!

5. EvanHSVtoRGB isn't a built-in function, to use it, you have to add its code at the end.

6. I have added Amount1, that will allow you to have a slider when you will build the DLL.

Now please go on...

Ok the code is now perfect thanks to madjik ( thanks dude! ) the only thing is that access to my effects folder is denied and im on my administrator account... :cry:

sig.png

Broken toaster =

(Rushes to HomeBase!)

Link to comment
Share on other sites

  • 2 weeks later...

Hey hey hey BoltBait! I've gone and found a bug!

When you use the Delete key to make a change to the code, it does not seem to realize that the code has changed and therefore does not recompile... Minor, I know, but I just thought I'd let you know.

xZYt6wl.png

ambigram signature by Kemaru

[i write plugins and stuff]

If you like a post, upvote it!

Link to comment
Share on other sites

Hey hey hey BoltBait! I've gone and found a bug!

When you use the Delete key to make a change to the code, it does not seem to realize that the code has changed and therefore does not recompile... Minor, I know, but I just thought I'd let you know.

Page one called... they want their bug report back... :D

http://paintdotnet.12.forumer.com/viewt ... =4617#4617

Link to comment
Share on other sites

Hey hey hey BoltBait! I've gone and found a bug!

When you use the Delete key to make a change to the code, it does not seem to realize that the code has changed and therefore does not recompile... Minor, I know, but I just thought I'd let you know.

Page one called... they want their bug report back... :D

http://paintdotnet.12.forumer.com/viewt ... =4617#4617

Owned :D

Link to comment
Share on other sites

  • 2 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...