Example #1
0
 public virtual void SetImageAttribute(ImageAttrib.Format imageType, byte[] imageData)
 {
     if (imageData == null)
     {
         throw new ArgumentException("attempt to set null image", "imageData");
     }
     list.Add(new ImageAttrib(imageType, imageData));
 }
 public virtual void SetImageAttribute(ImageAttrib.Format imageType, byte[] imageData)
 {
     //IL_000d: Unknown result type (might be due to invalid IL or missing references)
     if (imageData == null)
     {
         throw new ArgumentException("attempt to set null image", "imageData");
     }
     list.Add((object)new ImageAttrib(imageType, imageData));
 }
Example #3
0
        private static byte[] ToByteArray(ImageAttrib.Format imageType, byte[] imageData)
        {
            MemoryStream memoryStream = new MemoryStream();

            memoryStream.WriteByte(16);
            memoryStream.WriteByte(0);
            memoryStream.WriteByte(1);
            memoryStream.WriteByte((byte)imageType);
            memoryStream.Write(ImageAttrib.Zeroes, 0, ImageAttrib.Zeroes.Length);
            memoryStream.Write(imageData, 0, imageData.Length);
            return(memoryStream.ToArray());
        }
Example #4
0
 public ImageAttrib(ImageAttrib.Format imageType, byte[] imageData) : this(ImageAttrib.ToByteArray(imageType, imageData))
 {
 }