如何使用ItextSharp在图像周围绘制圆

时间:2018-11-15 04:18:09

标签: c# itext

        byte[] byt = DMC_StudentImage;
        Image img = Image.GetInstance(byt);
        float width = 100f;
        float height = 100f;

        PdfContentByte content = writer.DirectContent;            
        PdfTemplate temp = content.CreateTemplate(width, height);           
        temp.Ellipse(0, 0, width, height);
        temp.Clip();
        temp.NewPath();
        temp.AddImage(img, width, 0, 0, height, 0, 0);
        Image clipped = Image.GetInstance(temp);

我已经在上述代码的帮助下成功裁剪了图像,如图1所示。现在,我想在图像周围添加圆圈,如图2所示。 enter image description here

0 个答案:

没有答案