Travelling around pixels c# -
i want travel around black pixel (inmasca1
) until finds pixel different black. want search on row , column, not diagonally. after colored pixel in finded, assign black 1 colour. tried till now.
private bool inmasca1(color col) { return col.r == 0 || col.g == 0 || col.b == 0; } bitmap b = (bitmap)picturebox1.image; (int = 0; < b.width - 1; i++) { (int j = 0; j < b.height - 1; j++) { nou = b.getpixel(i, j); if (inmasca1(nou)) { (int l = 0; l < j; l++) { if (!inmasca1(b.getpixel(i, j + l))) { z0 = j + l; break; } else { if (!inmasca1(b.getpixel(i, j - l))) { z0 = j - l; break; } } } (int m = 0; m < i; m++) { if (!inmasca1(b.getpixel(i + m, j))) { t0 = + m; break; } else { if (!inmasca1(b.getpixel(i - m, j))) { t0 = - m; break; } } }
how can assign black pixel color of closest pixel different black?
Comments
Post a Comment