如何C#调整图片大小Docx

时间:2019-02-28 07:46:22

标签: c# image size add docx

我使用以下代码添加图片,但我没有调整图片大小

var myImageFullPath = "ex.jpg";

using (DocX document = DocX.Create("ex.docx"))
{
    Image image = document.AddImage(myImageFullPath);
    Picture picture = image.CreatePicture();
    Paragraph title = document.InsertParagraph().Append("TEST");
    title.Alignment = Alignment.center;        
    Paragraph p1 = document.InsertParagraph();
    p1.AppendPicture(picture);                
    document.Save();
}

1 个答案:

答案 0 :(得分:0)

已解决的THX 图片图片= image.CreatePicture(400,600);

相关问题