Exemplo n.º 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;
            }
        }
 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);
 }