private void SetPixel(Bitmap bmp, SetPixel setPixel) { for (int x = 0; x < LED.WIDTH; x++) { for (int y = 0; y < LED.HEIGHT; y++) { if (bmp.GetPixel(x, y).A != 0) { Console.WriteLine("x:" + x + " y:" + y); setPixel(x, y, RGB.fromColor(bmp.GetPixel(x, y))); } } } }
private void SetPixel(Bitmap bmp, SetPixel setPixel) { for (int x = 0; x < LED.WIDTH; x++) { for (int y = 0; y < LED.HEIGHT; y++) { Color pixel = bmp.GetPixel(x, y); if (pixel.A != 0 && pixel.ToArgb() != Color.Black.ToArgb()) { Console.WriteLine("x:" + x + " y:" + y); setPixel(x, y, RGB.fromColor(bmp.GetPixel(x, y))); } } } }
private Dot[] GetPixel(Bitmap bmp, PointF offset) { List <Dot> points = new List <Dot>(); for (int x = 0; x < bmp.Width; x++) { for (int y = 0; y < bmp.Height; y++) { if (bmp.GetPixel(x, y).A != 0) { points.Add(new Dot( (x / DENSITY + offset.X), (y / DENSITY + offset.Y), RGB.fromColor(bmp.GetPixel(x, y)))); } } } return(points.ToArray()); }