c# - 如何使用 ItextSharp 在图像周围绘制圆圈
问题描述
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);
解决方案
你可以用后面的圆圈做一个png图像,并在将图像添加到文档后将其放置。
推荐阅读
- python - 当 arg 已经包含 " " 和 ' ' 引号时,如何将字符串 arg 提交给 subprocess.run(arg, shell=True)?
- excel - 单击时如何制作用“组”字填充单元格以用于下一个空行的按钮宏
- php - else 条件有效,即使为真
- python - nn.Linear 如何在 shape(batch_size, seq_length, hidden_size) 中工作?
- html - 在 Firestore 中为新的 Firebase 身份验证帐户创建用户数据
- kubernetes - 通过 k8s 代理访问 Grafana API
- cron - crontab 不执行脚本,但可以手动执行
- azure-pipelines - 根据存储库名称使用不同的池/无法访问作业条件中的“Build.Repository.Name”变量
- typescript - 为什么打字稿编译器不警告用变量覆盖getter?
- python-3.x - ModuleNotFoundError:没有名为“celery.task.sets”的模块