回复 1楼taoke的帖子
可以RenderImage.Style.ImageAlign.StretchHorz/StretchVert设置为True.
参考代码如下:
- RenderImage image = new RenderImage(img);
- image.Height = 100;
- image.Width = 100;
- image.Style.ImageAlign.StretchHorz = true;
- image.Style.ImageAlign.StretchVert = true;
- RenderTable rt = new RenderTable();
- rt.Cells[0, 0].RenderObject = image;
- for (int i = 1; i < 10; i++)
- {
- rt.Cells[i, 0].Text = "i" + i.ToString();
- }
- _printDocument.Body.Children.Clear();
- _printDocument.Body.Children.Add(rt);
- _printDocument.Generate();
复制代码 |