internal void ReadImage(IExcelGenerator excel, RPLImageData image, string imageName, RPLReport report)
 {
     if (excel == null || image == null || report == null || imageName == null)
     {
         return;
     }
     SetMimeType(image.ImageMimeType);
     m_imageName = imageName;
     if (image.ImageData != null)
     {
         m_imageData = excel.CreateStream(imageName);
         m_imageData.Write(image.ImageData, 0, image.ImageData.Length);
     }
     else
     {
         if (image.ImageDataOffset <= 0)
         {
             m_imageData     = null;
             image.ImageData = null;
             return;
         }
         m_imageData = excel.CreateStream(imageName);
         report.GetImage(image.ImageDataOffset, m_imageData);
     }
     image.ImageData = null;
     if (image.GDIImageProps != null)
     {
         m_width                = image.GDIImageProps.Width;
         m_height               = image.GDIImageProps.Height;
         m_verticalResolution   = image.GDIImageProps.VerticalResolution;
         m_horizontalResolution = image.GDIImageProps.HorizontalResolution;
         m_imageFormat          = image.GDIImageProps.RawFormat;
     }
 }
        public void ReadImage(IExcelGenerator excel, RPLImageData image, string imageName, RPLReport report)
        {
            if (excel != null && image != null && report != null && imageName != null)
            {
                this.SetMimeType(image.ImageMimeType);
                this.m_imageName = imageName;
                if (image.ImageData != null)
                {
                    this.m_imageData = excel.CreateStream(imageName);
                    this.m_imageData.Write(image.ImageData, 0, image.ImageData.Length);
                    goto IL_008d;
                }
                if (image.ImageDataOffset > 0)
                {
                    this.m_imageData = excel.CreateStream(imageName);
                    report.GetImage(image.ImageDataOffset, this.m_imageData);
                    goto IL_008d;
                }
                this.m_imageData = null;
                image.ImageData  = null;
            }
            return;

IL_008d:
            image.ImageData = null;
            if (image.GDIImageProps != null)
            {
                this.m_width                = image.GDIImageProps.Width;
                this.m_height               = image.GDIImageProps.Height;
                this.m_verticalResolution   = image.GDIImageProps.VerticalResolution;
                this.m_horizontalResolution = image.GDIImageProps.HorizontalResolution;
                this.m_imageFormat          = image.GDIImageProps.RawFormat;
            }
        }
        public static Stream GetEmbeddedImageStream(RPLReport rplReport, long imageDataOffset, CreateAndRegisterStream createAndRegisterStream, string imageName)
        {
            Stream stream = null;

            if (imageDataOffset > 0)
            {
                stream = createAndRegisterStream(imageName, string.Empty, null, null, true, StreamOper.CreateOnly);
                rplReport.GetImage(imageDataOffset, stream);
            }
            return(stream);
        }
 public static bool GetImage(RPLReport rplReport, ref byte[] imageData, long imageDataOffset)
 {
     if (imageData != null)
     {
         return(true);
     }
     if (imageDataOffset <= 0)
     {
         return(false);
     }
     imageData = rplReport.GetImage(imageDataOffset);
     if (imageData == null)
     {
         return(false);
     }
     return(true);
 }