-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMoveFilter.cs
More file actions
30 lines (27 loc) · 873 Bytes
/
MoveFilter.cs
File metadata and controls
30 lines (27 loc) · 873 Bytes
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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Drawing;
namespace Filters
{
abstract class MoveFilter
{
protected abstract int positionX(int _x, int _y);
protected abstract int positionY(int _x, int _y);
public Bitmap processImage(Bitmap sourceMap)
{
Bitmap resultMap = new Bitmap(sourceMap.Width+100, sourceMap.Height+100);
for (int i = 0; i < sourceMap.Height; i++)
{
//worker.ReportProgress((int)((float)i / resultMap.Width * 100));
for (int j = 0; j < sourceMap.Width; j++)
{
resultMap.SetPixel(positionX(j, i), positionY(j, i), sourceMap.GetPixel(j, i));
}
}
return resultMap;
}
}
}