-
Notifications
You must be signed in to change notification settings - Fork 1
/
ch1_hello_dot.cs
35 lines (33 loc) · 1.02 KB
/
ch1_hello_dot.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// Name:
// Submenu:
// Author:
// Title:
// Version:
// Desc:
// Keywords:
// URL:
// Help:
void Render(Surface dst, Surface src, Rectangle rect)
{
// Delete any of these lines you don't need
Rectangle selection = EnvironmentParameters.GetSelection(src.Bounds).GetBoundsInt();
int CenterX = ((selection.Right - selection.Left) / 2) + selection.Left;
int CenterY = ((selection.Bottom - selection.Top) / 2) + selection.Top;
ColorBgra PrimaryColor = EnvironmentParameters.PrimaryColor;
ColorBgra CurrentPixel;
for (int y = rect.Top; y < rect.Bottom; y++)
{
if (IsCancelRequested) return;
for (int x = rect.Left; x < rect.Right; x++)
{
CurrentPixel = src[x,y];
if (x == CenterX && y == CenterY) {
CurrentPixel.R = PrimaryColor.R;
CurrentPixel.G = PrimaryColor.G;
CurrentPixel.B = PrimaryColor.B;
CurrentPixel.A = PrimaryColor.A;
}
dst[x,y] = CurrentPixel;
}
}
}