public Image(PDF pdf, PDFImage raw) { this.w = (float)raw.GetWidth(); this.h = (float)raw.GetHeight(); this.size = raw.GetSize(); Stream inputStream = raw.GetInputStream(); if (raw.GetColorComponents() == 1) { this.AddImage(pdf, inputStream, ImageType.PDF, this.w, this.h, this.size, "DeviceGray", 8); } else { this.AddImage(pdf, inputStream, ImageType.PDF, this.w, this.h, this.size, "DeviceRGB", 8); } inputStream.Dispose(); }
/** * Use of this constructor will result in reduced memory consumption and faster processing. * Please see Example_24 */ public Image(PDF pdf, PDFImage raw) { this.w = raw.GetWidth(); this.h = raw.GetHeight(); this.size = raw.GetSize(); Stream stream = raw.GetInputStream(); if (raw.GetColorComponents() == 1) { AddImage(pdf, stream, ImageType.PDF, w, h, size, "DeviceGray", 8); } else { AddImage(pdf, stream, ImageType.PDF, w, h, size, "DeviceRGB", 8); } stream.Dispose(); }