/// <summary> /// Reads a BMP from a stream. The stream is not closed. /// The BMP may not have a header and be considered as a plain DIB. /// @throws IOException on error /// </summary> /// <param name="isp">the stream</param> /// <param name="noHeader">true to process a plain DIB</param> /// <param name="size">the size of the DIB. Not used for a BMP</param> /// <returns>the image</returns> public static Image GetImage(Stream isp, bool noHeader, int size) { BmpImage bmp = new BmpImage(isp, noHeader, size); Image img = bmp.getImage(); img.SetDpi((int)(bmp._xPelsPerMeter * 0.0254 + 0.5), (int)(bmp._yPelsPerMeter * 0.0254 + 0.5)); img.OriginalType = Image.ORIGINAL_BMP; return(img); }
/** Reads a BMP from a stream. The stream is not closed. * The BMP may not have a header and be considered as a plain DIB. * @param is the stream * @param noHeader true to process a plain DIB * @param size the size of the DIB. Not used for a BMP * @throws IOException on error * @return the image */ public static Image GetImage(Stream isp, bool noHeader, int size) { BmpImage bmp = new BmpImage(isp, noHeader, size); Image img = bmp.GetImage(); img.SetDpi((int)((double)bmp.xPelsPerMeter * 0.0254 + 0.5), (int)((double)bmp.yPelsPerMeter * 0.0254 + 0.5)); img.OriginalType = Image.ORIGINAL_BMP; return img; }