Rick Brewster

CodeLab v4.4 (for advanced users) Released November 23, 2019

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!

Share this post


Link to post
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?

Share this post


Link to post
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?

Share this post


Link to post
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.

Share this post


Link to post
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;
		}
	}
}
}

Share this post


Link to post
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?

Share this post


Link to post
Share on other sites

I'm not going to ban you for that.

Just stop putting bugs into my code!

Share this post


Link to post
Share on other sites

Ah I don't know C# or any of that and I dont really want to. But I DO want to make any bloody potato that you guys stick on here in C# into a dll but it won't let me.

Anything I should know to figure this out?

Share this post


Link to post
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...

Share this post


Link to post
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:

Share this post


Link to post
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.

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites
Rick (or BB I guess) will you ever be releasing the codelab script, for us to browse and look at?

You mean the source code to CodeLab? If so, it is available for download on my page. (Link in sig)

Share this post


Link to post
Share on other sites
Rick (or BB I guess) will you ever be releasing the codelab script, for us to browse and look at?

You mean the source code to CodeLab? If so, it is available for download on my page. (Link in sig)

One final question, where do you get Visual Studio from?

Share this post


Link to post
Share on other sites
Microsoft, try searching microsofts site for it :)

There's a free version & a version that you have to pay money for.

Thanks.

I'll download it when I've learnt enough C# that I can transfer it to another program, which leads the question, is there anywhere where you can learn it?

Share this post


Link to post
Share on other sites

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.