Jump to content

Requesting C# Tutorial


Recommended Posts

I have read the source code for several plugins, scoured the internet for tutorials, and searched everywhere, but I have yet to find a decent C# tutorial. I just want someone to teach me how to convert pseudocode into a plugin.

Rainbow%20Space%20Sig.png

The God of Judgement is not pleased...

Link to comment
Share on other sites

You've read of course this:

How to Write an Effect Plugin (Part 1 of 3 - Simple)

http://paintdotnet.12.forumer.com/viewtopic.php?t=5281

How to Write an Effect Plugin (Part 2 of 3 - Intermediate)

http://paintdotnet.12.forumer.com/viewtopic.php?t=5308

Could you share a pseudo code we could work on and see how you could learn about coding in C#?

Link to comment
Share on other sites

Pseudocode such as:

Find the alpha of a pixel.

Save it as a variable.

Make the variable 255-itself.

Make the pixel's alpha the variable.

It's a simple Invert Alpha plugin.

And I have read the tutorials, but they're too cryptic and I don't learn much about C#.

Rainbow%20Space%20Sig.png

The God of Judgement is not pleased...

Link to comment
Share on other sites

Yes it's not the best way to start to learn programming!

You could (as I do) learn C# if you already have a knowlegde of programming. Have you ever created your "Hello world!" program ? ;)

BTW from your pseudocode, I open the codelab, deleted the useless lines from the model then adjust one line to obtain the desired effect:

void Render(Surface dst, Surface src, Rectangle rect)
{
 ColorBgra CurrentPixel;
 for(int y = rect.Top; y < rect.Bottom; y++)
 {
   for (int x = rect.Left; x < rect.Right; x++)
   {
     CurrentPixel = src[x,y];
     CurrentPixel.A = (byte)(255 - CurrentPixel.A); // desired effect
     dst[x,y] = CurrentPixel;
   }
 }
}

Shouldn't the true value be 256 ?

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

 Share

×
×
  • Create New...