代码之家  ›  专栏  ›  技术社区  ›  Usman Ali

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

  •  0
  • Usman Ali  · 技术社区  · 6 年前
            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);
    

    enter image description here

    0 回复  |  直到 6 年前