private static void GetMinMaxPixel(out Color Min, out Color Max, BitmapData ImageData, int PixelSize) { ImageData.ThrowIfNull("ImageData"); int MinR = 255, MinG = 255, MinB = 255; int MaxR = 0, MaxG = 0, MaxB = 0; for (int x = 0; x < ImageData.Width; ++x) { for (int y = 0; y < ImageData.Height; ++y) { Color TempImage = ImageData.GetPixel(x, y, PixelSize); if (MinR > TempImage.R) MinR = TempImage.R; if (MaxR < TempImage.R) MaxR = TempImage.R; if (MinG > TempImage.G) MinG = TempImage.G; if (MaxG < TempImage.G) MaxG = TempImage.G; if (MinB > TempImage.B) MinB = TempImage.B; if (MaxB < TempImage.B) MaxB = TempImage.B; } } Min = Color.FromArgb(MinR, MinG, MinB); Max = Color.FromArgb(MaxR, MaxG, MaxB); }
private static float GetHeight(int x, int y, BitmapData BlackAndWhiteData, int BlackAndWhitePixelSize) { Contract.Requires<ArgumentNullException>(BlackAndWhiteData != null, "BlackAndWhiteData"); Color TempColor = BlackAndWhiteData.GetPixel(x, y, BlackAndWhitePixelSize); return GetHeight(TempColor); }
private static float GetHeight(int x, int y, BitmapData BlackAndWhiteData, int BlackAndWhitePixelSize) { BlackAndWhiteData.ThrowIfNull("BlackAndWhiteData"); Color TempColor = BlackAndWhiteData.GetPixel(x, y, BlackAndWhitePixelSize); return GetHeight(TempColor); }
private static float GetHeight(int x, int y, BitmapData BlackAndWhiteData, int BlackAndWhitePixelSize) { if (BlackAndWhiteData == null) throw new ArgumentNullException("BlackAndWhiteData"); Color TempColor = BlackAndWhiteData.GetPixel(x, y, BlackAndWhitePixelSize); return GetHeight(TempColor); }