Example #1
0
        public override void DrawImage(RectangleF position, RPLImage image, RPLImageProps instanceProperties, RPLImagePropsDef definitionProperties)
        {
            RPLImageData image2 = instanceProperties.Image;

            System.Drawing.Image image3 = default(System.Drawing.Image);
            bool flag = this.GetImage(image2.ImageName, image2.ImageData, image2.ImageDataOffset, false, out image3);

            RPLFormat.Sizings sizing = definitionProperties.Sizing;
            if (image3 == null)
            {
                this.GetDefaultImage(out image3);
                flag   = true;
                sizing = RPLFormat.Sizings.Clip;
            }
            GDIImageProps gDIImageProps = new GDIImageProps(image3);
            RectangleF    destination   = default(RectangleF);
            RectangleF    source        = default(RectangleF);

            SharedRenderer.CalculateImageRectangle(position, gDIImageProps.Width, gDIImageProps.Height, (float)this.m_measureImageDpiX, (float)this.m_measureImageDpiY, sizing, out destination, out source);
            this.m_graphics.DrawImage(image3, destination, source);
            if (!flag)
            {
                image3.Dispose();
                image3 = null;
            }
        }
Example #2
0
        public override void WriteCustomNonSharedItemProps(RPLElementProps nonSharedProps, PageContext pageContext)
        {
            AspNetCore.ReportingServices.OnDemandReportRendering.Image image = (AspNetCore.ReportingServices.OnDemandReportRendering.Image)base.m_source;
            ImageInstance imageInstance = (ImageInstance)image.Instance;
            RPLImageProps rPLImageProps = (RPLImageProps)nonSharedProps;

            if (this.m_invalidImage)
            {
                base.WriteInvalidImage(rPLImageProps, pageContext, this.m_imageProps);
            }
            else
            {
                base.WriteImage(imageInstance, null, rPLImageProps, pageContext, this.m_imageProps);
            }
            rPLImageProps.ActionInfo = PageItem.WriteActionInfo(image.ActionInfo);
        }
Example #3
0
        internal override void WriteCustomNonSharedItemProps(RPLElementProps nonSharedProps, PageContext pageContext)
        {
            Microsoft.ReportingServices.OnDemandReportRendering.Image image = (Microsoft.ReportingServices.OnDemandReportRendering.Image)m_source;
            ImageInstance imageInstance = (ImageInstance)image.Instance;
            RPLImageProps rPLImageProps = (RPLImageProps)nonSharedProps;

            if (m_invalidImage)
            {
                WriteInvalidImage(rPLImageProps, pageContext, m_imageProps);
            }
            else
            {
                WriteImage(imageInstance, null, rPLImageProps, pageContext, m_imageProps);
            }
            rPLImageProps.ActionInfo = PageItem.WriteActionInfo(image.ActionInfo);
        }
Example #4
0
        internal override void WriteCustomNonSharedItemProps(RPLElementProps nonSharedProps, RPLWriter rplWriter, PageContext pageContext)
        {
            Microsoft.ReportingServices.OnDemandReportRendering.Image image = (Microsoft.ReportingServices.OnDemandReportRendering.Image)m_source;
            ImageInstance imageInstance = (ImageInstance)image.Instance;

            System.Drawing.Image gdiImage      = null;
            RPLImageProps        rPLImageProps = (RPLImageProps)nonSharedProps;

            if (AutoSizeImage(pageContext, imageInstance, out gdiImage))
            {
                WriteImage(null, "InvalidImage", rPLImageProps, pageContext, gdiImage);
            }
            else
            {
                WriteImage(imageInstance, null, rPLImageProps, pageContext, gdiImage);
            }
            rPLImageProps.ActionInfo          = WriteActionInfo(image.ActionInfo, pageContext);
            rPLImageProps.ActionImageMapAreas = WriteImageMapAreaInstanceCollection(imageInstance.ActionInfoWithDynamicImageMapAreas, pageContext);
        }
        internal override void DrawImage(RectangleF position, RPLImage image, RPLImageProps instanceProperties, RPLImagePropsDef definitionProperties)
        {
            RPLImageData image2 = instanceProperties.Image;

            System.Drawing.Image image3;
            bool flag = GetImage(image2.ImageName, image2.ImageData, image2.ImageDataOffset, dynamicImage: false, out image3);

            RPLFormat.Sizings sizing = definitionProperties.Sizing;
            if (image3 == null)
            {
                GetDefaultImage(out image3);
                flag   = true;
                sizing = RPLFormat.Sizings.Clip;
            }
            GDIImageProps gDIImageProps = new GDIImageProps(image3);

            SharedRenderer.CalculateImageRectangle(position, gDIImageProps.Width, gDIImageProps.Height, m_measureImageDpiX, m_measureImageDpiY, sizing, out RectangleF imagePositionAndSize, out RectangleF imagePortion);
            m_graphics.DrawImage(image3, imagePositionAndSize, imagePortion);
            if (!flag)
            {
                image3.Dispose();
                image3 = null;
            }
        }
Example #6
0
        public void RenderReportItem(RPLElement reportItem, RPLItemMeasurement measurement, StyleContext styleContext, ref int borderContext, bool renderId, bool treatAsTopLevel)
        {
            RPLImageProps    rPLImageProps    = (RPLImageProps)reportItem.ElementProps;
            RPLImagePropsDef rPLImagePropsDef = (RPLImagePropsDef)rPLImageProps.Definition;

            RPLFormat.Sizings sizing = rPLImagePropsDef.Sizing;
            RPLImageData      image  = rPLImageProps.Image;

            this.html5Renderer.GetInnerContainerHeightSubtractBorders(measurement, rPLImageProps.Style);
            float  innerContainerWidthSubtractBorders = this.html5Renderer.GetInnerContainerWidthSubtractBorders(measurement, rPLImageProps.Style);
            string text      = this.html5Renderer.GetImageUrl(true, image);
            string ariaLabel = null;
            string role      = null;
            string tooltip   = this.html5Renderer.GetTooltip(rPLImageProps);

            if (treatAsTopLevel)
            {
                ariaLabel = (string.IsNullOrEmpty(tooltip) ? RenderRes.AccessibleImageLabel : RenderRes.AccessibleImageNavigationGroupLabel(tooltip));
                role      = HTMLElements.m_navigationRole;
            }
            string altText = string.IsNullOrEmpty(tooltip) ? RenderRes.AccessibleImageLabel : tooltip;
            Dictionary <string, string> dictionary = new Dictionary <string, string>();

            if (this.html5Renderer.m_elementExtender.ShouldApplyToElement(treatAsTopLevel))
            {
                dictionary.Add(HTMLElements.m_reportItemDataName, this.html5Renderer.m_elementExtender.ApplyToElement());
                dictionary.Add(HTMLElements.m_reportItemCustomAttrStr, this.html5Renderer.GetReportItemPath(rPLImagePropsDef.Name));
            }
            bool flag = rPLImageProps.ActionImageMapAreas != null && rPLImageProps.ActionImageMapAreas.Length > 0;

            if (flag)
            {
                string s = HTMLElements.m_hashTag + this.html5Renderer.m_deviceInfo.HtmlPrefixId + HTMLElements.m_mapPrefixString + rPLImageProps.UniqueName;
                dictionary.Add(HTMLElements.m_useMapName, HttpUtility.HtmlAttributeEncode(s));
            }
            if (this.html5Renderer.HasAction(rPLImageProps.ActionInfo))
            {
                this.RenderElementHyperlink(rPLImageProps.Style, rPLImageProps.ActionInfo.Actions[0]);
            }
            if (!styleContext.InTablix)
            {
                if (sizing == RPLFormat.Sizings.AutoSize)
                {
                    styleContext.RenderMeasurements = false;
                }
                this.html5Renderer.WriteStream(HTMLElements.m_openDiv);
                this.html5Renderer.RenderReportItemStyle(reportItem, (RPLElementProps)rPLImageProps, (RPLElementPropsDef)rPLImagePropsDef, measurement, styleContext, ref borderContext, rPLImagePropsDef.ID);
                this.html5Renderer.WriteStream(HTMLElements.m_closeBracket);
            }
            if (string.IsNullOrEmpty(text))
            {
                text = "data:image/gif;base64," + Convert.ToBase64String(HTMLRendererResources.GetBytes("Blank.gif"));
            }
            HtmlElement htmlElement;

            switch (sizing)
            {
            case RPLFormat.Sizings.FitProportional:
                htmlElement = new FitProportionalImageElement(text, innerContainerWidthSubtractBorders, role, altText, ariaLabel, dictionary);
                break;

            case RPLFormat.Sizings.Fit:
                htmlElement = new FitImageElement(text, role, altText, ariaLabel, dictionary);
                break;

            case RPLFormat.Sizings.Clip:
                htmlElement = new ClipImageElement(text, role, altText, ariaLabel, dictionary);
                break;

            default:
                htmlElement = new OriginalSizeImageElement(text, role, altText, ariaLabel, dictionary);
                break;
            }
            htmlElement.Render(new Html5OutputStream(this.html5Renderer));
            if (!styleContext.InTablix)
            {
                this.html5Renderer.WriteStream(HTMLElements.m_closeDiv);
            }
            if (this.html5Renderer.HasAction(rPLImageProps.ActionInfo))
            {
                this.html5Renderer.WriteStream(HTMLElements.m_closeA);
            }
            if (flag)
            {
                this.html5Renderer.RenderImageMapAreas(rPLImageProps.ActionImageMapAreas, (double)measurement.Width, (double)measurement.Height, rPLImageProps.UniqueName, 0, 0);
            }
        }
Example #7
0
 internal RPLImage()
 {
     m_rplElementProps            = new RPLImageProps();
     m_rplElementProps.Definition = new RPLImagePropsDef();
 }
Example #8
0
 public virtual void DrawImage(RectangleF position, RPLImage image, RPLImageProps instanceProperties, RPLImagePropsDef definitionProperties)
 {
 }