Přidat otázku mezi oblíbenéZasílat nové odpovědi e-mailem Vykreslení obrázku z byte array

Tak jsem to trochu upravil a pořád nejde.


            BinaryReader reader = new BinaryReader(stream);
            int range = (int)reader.BaseStream.Length;
            Byte[] bytes = reader.ReadBytes(range);
            int width = 361;
            int height = 338;
            Byte[] newBytes = null;
            Array.Copy(bytes, 0, newBytes, 54, range - 54);
            BitArray bity = new BitArray(newBytes);

            Bitmap bmp = new Bitmap(width, height);

            for (int y = 0; y < height; y++)
            {
                for (int x = 0; x < width; x++)
                {
                    if (bity[y * width + x] == true)
                    {
                        bmp.SetPixel(x, y, Color.Black);
                    }
                }
            }

Reakce na odpověď

1 Zadajte svou přezdívku:
2 Napište svou odpověď:
3 Pokud chcete dostat ban, zadejte libovolný text:

Zpět do poradny