PdfSharp.Drawing.XGraphics.DrawImage C# (CSharp) Method

DrawImage() public method

Draws the specified image.
public DrawImage ( XImage image, PointF point ) : void
image XImage
point PointF
return void
    public void DrawImage(XImage image, PointF point)
    {
      DrawImage(image, point.X, point.Y);
    }
#endif

Same methods

XGraphics::DrawImage ( XImage image, Rectangle rect ) : void
XGraphics::DrawImage ( XImage image, Rectangle destRect, Rectangle srcRect, XGraphicsUnit srcUnit ) : void
XGraphics::DrawImage ( XImage image, RectangleF rect ) : void
XGraphics::DrawImage ( XImage image, RectangleF destRect, RectangleF srcRect, XGraphicsUnit srcUnit ) : void
XGraphics::DrawImage ( XImage image, System point ) : void
XGraphics::DrawImage ( XImage image, XPoint point ) : void
XGraphics::DrawImage ( XImage image, XRect rect ) : void
XGraphics::DrawImage ( XImage image, XRect destRect, XRect srcRect, XGraphicsUnit srcUnit ) : void
XGraphics::DrawImage ( XImage image, double x, double y ) : void
XGraphics::DrawImage ( XImage image, double x, double y, double width, double height ) : void
XGraphics::DrawImage ( XImage image, int x, int y ) : void
XGraphics::DrawImage ( XImage image, int x, int y, int width, int height ) : void

Usage Example

Ejemplo n.º 1
0
        public override void Render(ref PdfSharp.Drawing.XGraphics gfx, double offsetLeft, double offsetTop, double scaleX, double scaleY)
        {
            PreRender(ref gfx, offsetLeft, offsetTop, scaleX, scaleY);

            double imgwidth  = Util.MillimeterToPoint(ImageWidth) * scaleX,
                   imgheight = Util.MillimeterToPoint(ImageHeight) * scaleY,
                   imgpadx   = Util.MillimeterToPoint(ImagePaddingX) * scaleX,
                   imgpady   = Util.MillimeterToPoint(ImagePaddingY) * scaleY,
                   left      = Util.MillimeterToPoint(offsetLeft + Left),
                   top       = Util.MillimeterToPoint(offsetTop + Top),
                   width     = Util.MillimeterToPoint(Width * scaleX),
                   height    = Util.MillimeterToPoint(Height * scaleY);


            for (double y = 0; y + imgpady + imgheight < height; y += imgheight + imgpady)
            {
                if (RightToLeft)
                {
                    for (double x = width - imgwidth; x > 0; x -= imgwidth + imgpadx)
                    {
                        if (images.Count > 0)
                        {
                            gfx.DrawImage((XImage)images.Dequeue(), left + x, top + y, imgwidth, imgheight);
                        }
                        else
                        {
                            break;
                        }
                    }
                }
                else
                {
                    for (double x = 0; x + imgpadx + imgwidth < width; x += imgwidth + imgpadx)
                    {
                        if (images.Count > 0)
                        {
                            gfx.DrawImage((XImage)images.Dequeue(), left + x, top + y, imgwidth, imgheight);
                        }
                        else
                        {
                            break;
                        }
                    }
                }

                if (images.Count == 0)
                {
                    break;
                }
            }


            base.Render(ref gfx, offsetLeft, offsetTop, scaleX, scaleY);
        }
All Usage Examples Of PdfSharp.Drawing.XGraphics::DrawImage