-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRedraw.cs
More file actions
27 lines (26 loc) · 934 Bytes
/
Copy pathRedraw.cs
File metadata and controls
27 lines (26 loc) · 934 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
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Edge_Detection
{
class Redraw
{
public Bitmap draw(int Sensitivity,int[,] RedChannel,int[,] GreenChannel,int[,] BlueChannel,int height,int width)
{
Bitmap result = new Bitmap(width, height);
LockBitmap res = new LockBitmap(result);
res.LockBits();
for (int i = 0; i < width; i++)
for (int j = 0; j < height; j++)
if (RedChannel[i, j] >= Sensitivity || GreenChannel[i, j] >= Sensitivity )
res.SetPixel(i, j, Properties.Settings.Default.Pen);
else
res.SetPixel(i, j, Properties.Settings.Default.Pallete);
res.UnlockBits();
return result;
}
}
}