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; } }
private void CheckAutoSize(AspNetCore.ReportingServices.OnDemandReportRendering.Image image, PageContext pageContext) { if (image.Sizing == AspNetCore.ReportingServices.OnDemandReportRendering.Image.Sizings.AutoSize) { ImageInstance imageInstance = (ImageInstance)image.Instance; System.Drawing.Image image2 = null; this.m_invalidImage = this.AutoSizeImage(pageContext, imageInstance, out image2); if (image2 != null) { this.m_imageProps = new GDIImageProps(image2); image2.Dispose(); } } }
private void CheckAutoSize(Microsoft.ReportingServices.OnDemandReportRendering.Image image, PageContext pageContext) { if (image.Sizing == Microsoft.ReportingServices.OnDemandReportRendering.Image.Sizings.AutoSize) { ImageInstance imageInstance = (ImageInstance)image.Instance; System.Drawing.Image gdiImage = null; m_invalidImage = AutoSizeImage(pageContext, imageInstance, out gdiImage); if (gdiImage != null) { m_imageProps = new GDIImageProps(gdiImage); gdiImage.Dispose(); } } }
public override void Deserialize(IntermediateFormatReader reader) { base.Deserialize(reader); IScalabilityCache scalabilityCache = reader.PersistenceHelper as IScalabilityCache; reader.RegisterDeclaration(Image.m_declaration); while (reader.NextMember()) { switch (reader.CurrentMember.MemberName) { case MemberName.InvalidImage: this.m_invalidImage = reader.ReadBoolean(); break; case MemberName.ImageProps: { int id = reader.ReadInt32(); this.m_imageProps = (GDIImageProps)scalabilityCache.FetchStaticReference(id); break; } case MemberName.StreamName: this.m_streamName = reader.ReadString(); break; case MemberName.HorizontalPadding: this.m_padHorizontal = reader.ReadDouble(); break; case MemberName.VerticalPadding: this.m_padVertical = reader.ReadDouble(); break; default: RSTrace.RenderingTracer.Assert(false, string.Empty); break; } } }
public static bool GetImage(RPLReport rplReport, ref byte[] imageData, long imageDataOffset, ref GDIImageProps gdiImageProps) { if (SharedRenderer.GetImage(rplReport, ref imageData, imageDataOffset)) { if (gdiImageProps == null) { try { using (Image image = Image.FromStream(new MemoryStream(imageData))) { gdiImageProps = new GDIImageProps(image); } } catch { return(false); } } return(true); } return(false); }
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; } }
public static void CalculateImageRectangle(RectangleF position, GDIImageProps gdiProperties, RPLFormat.Sizings sizing, out RectangleF imagePositionAndSize, out RectangleF imagePortion) { SharedRenderer.CalculateImageRectangle(position, gdiProperties.Width, gdiProperties.Height, gdiProperties.HorizontalResolution, gdiProperties.VerticalResolution, sizing, out imagePositionAndSize, out imagePortion); }