iTextSharp.text.pdf.codec.BmpImage.IndexedModel C# (CSharp) Метод

IndexedModel() приватный Метод

private IndexedModel ( byte bdata, int bpc, int paletteEntries ) : Image
bdata byte
bpc int
paletteEntries int
Результат Image
        private Image IndexedModel(byte[] bdata, int bpc, int paletteEntries)
        {
            Image img = new ImgRaw(width, height, 1, bpc, bdata);
            PdfArray colorspace = new PdfArray();
            colorspace.Add(PdfName.INDEXED);
            colorspace.Add(PdfName.DEVICERGB);
            byte[] np = GetPalette(paletteEntries);
            int len = np.Length;
            colorspace.Add(new PdfNumber(len / 3 - 1));
            colorspace.Add(new PdfString(np));
            PdfDictionary ad = new PdfDictionary();
            ad.Put(PdfName.COLORSPACE, colorspace);
            img.Additional = ad;
            return img;
        }