public SetPixelA ( int x, int y, byte value ) : void | ||
x | int | |
y | int | |
value | byte | |
리턴 | void |
public Bmp ToHighContrastClone() { double h, s, l; Bmp bmpHighContrast = new Bmp(Width, Height); for (int y = 0; y < Height; y++) { for (int x = 0; x < Width; x++) { if (GetPixelA(x, y) < byte.MaxValue / 2) { bmpHighContrast.SetPixelA(x, y, 0); bmpHighContrast.SetPixelR(x, y, 0); bmpHighContrast.SetPixelG(x, y, 0); bmpHighContrast.SetPixelB(x, y, 0); } else { RgbToHsl(GetPixelR(x, y), GetPixelG(x, y), GetPixelB(x, y), out h, out s, out l); if (l < 0.5) { bmpHighContrast.SetPixelA(x, y, 255); bmpHighContrast.SetPixelR(x, y, 0); bmpHighContrast.SetPixelG(x, y, 0); bmpHighContrast.SetPixelB(x, y, 0); } else { bmpHighContrast.SetPixelA(x, y, 255); bmpHighContrast.SetPixelR(x, y, 255); bmpHighContrast.SetPixelG(x, y, 255); bmpHighContrast.SetPixelB(x, y, 255); } } } } return(bmpHighContrast); }
public Bmp ___CutRectangle(Rectangle rect) { Bmp bmpCut = new Bmp(rect.Width, rect.Height); for (int y = rect.Y; y < rect.Height; y++) { for (int x = rect.X; x < rect.Width; x++) { bmpCut.SetPixelA(x - rect.X, y - rect.Y, GetPixelA(x, y)); } } return(bmpCut); }
public Bmp ___CutRectangle(Rectangle rect) { Bmp bmpCut = new Bmp(rect.Width, rect.Height); for (int y = rect.Y; y < rect.Height; y++) { for (int x = rect.X; x < rect.Width; x++) { bmpCut.SetPixelA(x - rect.X, y - rect.Y, GetPixelA(x, y)); } } return bmpCut; }
public Bmp ToHighContrastClone() { double h, s, l; Bmp bmpHighContrast = new Bmp(Width, Height); for (int y = 0; y < Height; y++) { for (int x = 0; x < Width; x++) { if (GetPixelA(x, y) < byte.MaxValue / 2) { bmpHighContrast.SetPixelA(x, y, 0); bmpHighContrast.SetPixelR(x, y, 0); bmpHighContrast.SetPixelG(x, y, 0); bmpHighContrast.SetPixelB(x, y, 0); } else { RgbToHsl(GetPixelR(x, y), GetPixelG(x, y), GetPixelB(x, y), out h, out s, out l); if (l < 0.5) { bmpHighContrast.SetPixelA(x, y, 255); bmpHighContrast.SetPixelR(x, y, 0); bmpHighContrast.SetPixelG(x, y, 0); bmpHighContrast.SetPixelB(x, y, 0); } else { bmpHighContrast.SetPixelA(x, y, 255); bmpHighContrast.SetPixelR(x, y, 255); bmpHighContrast.SetPixelG(x, y, 255); bmpHighContrast.SetPixelB(x, y, 255); } } } } return bmpHighContrast; }