Jump to content

Ndshacker

Members
  • Posts

    10
  • Joined

  • Last visited

Posts posted by Ndshacker

  1. :? when I said this:

    ColorBgra CurrentPixel; selecting the pixel, using C if im not mistaken

    I meant this whole part

    ColorBgra CurrentPixel; selecting the pixel, using C if im not mistaken

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

    {

    for (int x = rect.Left; x < rect.Right; x++)

    {

    CurrentPixel = src[x,y];

    if ((y == CenterY) && (x == CenterX))

    {

    I think im still wrong, but just wanted to clarify that. Im hoping we learn this kind of stuff next year in Grade 10 (or at least something applicable)

  2. :? when I said this:

    ColorBgra CurrentPixel; selecting the pixel, using C if im not mistaken

    I meant this whole part

    ColorBgra CurrentPixel; selecting the pixel, using C if im not mistaken

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

    {

    for (int x = rect.Left; x < rect.Right; x++)

    {

    CurrentPixel = src[x,y];

    if ((y == CenterY) && (x == CenterX))

    {

    I think im still wrong, but just wanted to clarify that. Im hoping we learn this kind of stuff next year in Grade 10 (or at least something applicable)

  3. Sorry to necro this topic -.- But I would like to see if I cant figure out how this plugin works (Dot at center)

    My notes are under lined

    void Render(Surface dst, Surface src, Rectangle rect) This tells us its going to render using a series of rectangles

    {

    // Delete any of these lines you don't need

    Rectangle selection = this.EnvironmentParameters.GetSelection(src.Bounds).GetBoundsInt(); This gets the parameters of your canvas as in Height and lenghth.

    long CenterX = (long)(((selection.Right - selection.Left) / 2)+selection.Left); This uses a basic formula to find the middle of our x axis.

    long CenterY = (long)(((selection.Bottom - selection.Top) / 2)+selection.Top); Same as above only for y axis

    ColorBgra PrimaryColor = (ColorBgra)EnvironmentParameters.PrimaryColor; The next three lines find our colors and the brush size.

    ColorBgra SecondaryColor = (ColorBgra)EnvironmentParameters.SecondaryColor;

    int BrushWidth = (int)EnvironmentParameters.BrushWidth;

    ColorBgra CurrentPixel; selecting the pixel, using C if im not mistaken

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

    {

    for (int x = rect.Left; x < rect.Right; x++)

    {

    CurrentPixel = src[x,y];

    if ((y == CenterY) && (x == CenterX))

    {

    // TODO: Add pixel processing code here And finally it gets colored

    // Access RGBA values this way, for example:

    CurrentPixel.R = (byte)PrimaryColor.R;

    CurrentPixel.G = (byte)PrimaryColor.G;

    CurrentPixel.B = (byte)PrimaryColor.B;

    CurrentPixel.A = (byte)PrimaryColor.A;

    }

    dst[x,y] = CurrentPixel;

    }

    }

    }

    Sorry if this seemed noobish, but i am really interested in making effects. And considering my age,I have lots of time to learn :)

  4. Sorry to necro this topic -.- But I would like to see if I cant figure out how this plugin works (Dot at center)

    My notes are under lined

    void Render(Surface dst, Surface src, Rectangle rect) This tells us its going to render using a series of rectangles

    {

    // Delete any of these lines you don't need

    Rectangle selection = this.EnvironmentParameters.GetSelection(src.Bounds).GetBoundsInt(); This gets the parameters of your canvas as in Height and lenghth.

    long CenterX = (long)(((selection.Right - selection.Left) / 2)+selection.Left); This uses a basic formula to find the middle of our x axis.

    long CenterY = (long)(((selection.Bottom - selection.Top) / 2)+selection.Top); Same as above only for y axis

    ColorBgra PrimaryColor = (ColorBgra)EnvironmentParameters.PrimaryColor; The next three lines find our colors and the brush size.

    ColorBgra SecondaryColor = (ColorBgra)EnvironmentParameters.SecondaryColor;

    int BrushWidth = (int)EnvironmentParameters.BrushWidth;

    ColorBgra CurrentPixel; selecting the pixel, using C if im not mistaken

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

    {

    for (int x = rect.Left; x < rect.Right; x++)

    {

    CurrentPixel = src[x,y];

    if ((y == CenterY) && (x == CenterX))

    {

    // TODO: Add pixel processing code here And finally it gets colored

    // Access RGBA values this way, for example:

    CurrentPixel.R = (byte)PrimaryColor.R;

    CurrentPixel.G = (byte)PrimaryColor.G;

    CurrentPixel.B = (byte)PrimaryColor.B;

    CurrentPixel.A = (byte)PrimaryColor.A;

    }

    dst[x,y] = CurrentPixel;

    }

    }

    }

    Sorry if this seemed noobish, but i am really interested in making effects. And considering my age,I have lots of time to learn :)

×
×
  • Create New...