Using PDFsharp NuGet v1.32.3057.0 on a windows form application.
I'm trying to figure out how I can define an XRect and tile an XImage all the way to bottom. If the image goes past the bottom of the rectangle, I want it to cut the image off at the bottom of the rectangle.
So right now, I have the tiling portion done. I can't figure out how to use the image transformations to cut the image off.
Tiling portion -
Code:
XRect graphicRect = newXRect(topLeftPt, bottomRightPt);
double imageY;
double width = scale * image.PointWidth;
double height = scale * image.PointHeight;
for (imageY = 0; imageY < graphicRect.Height - height; imageY += height)
{
gfx.DrawImage(image, graphicRect.X, graphicRect.Y + imageY, width, height);
}
After this, I have the line
Code:
gfx.DrawImage(image, graphicRect.X, graphicRect.Y + imageY, width, graphicRect.Height - imageY);
This skews the image dimensions to fit the remaining space. What I'd like to do is just cut the rest of the image off after the bottom of the rectangle has been reached. Does anyone know how to accomplish this?