/// <summary> /// Initializes a new instance based on the specified FreeImage bitmap. /// </summary> /// <param name="dib">Handle to a FreeImage bitmap.</param> /// <param name="scanline">Index of the zero based scanline.</param> public Scanline(FIBITMAP dib, int scanline) : this(dib, scanline, (int)(typeof(T) == typeof(FI1BIT) ? FreeImage.GetBPP(dib) * FreeImage.GetWidth(dib) : typeof(T) == typeof(FI4BIT) ? FreeImage.GetBPP(dib) * FreeImage.GetWidth(dib) / 4 : FreeImage.GetBPP(dib) * FreeImage.GetWidth(dib) / (Marshal.SizeOf(typeof(T)) * 8))) { }