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);
}