iTextSharp - How to input image (PNG) from project resource?

白昼怎懂夜的黑 提交于 2019-12-04 12:42:12

One of the overloads for iTextSharp.text.Image.GetInstance() takes an System.Drawing.Image, so convert your PNG resource into this type and then use this overload. Something like this:

Dim test As System.Drawing.Image = System.Drawing.Image.FromHbitmap(My.Resources.MyImage.GetHbitmap())
Dim logo As iTextSharp.text.Image = iTextSharp.text.Image.GetInstance(test, System.Drawing.Imaging.ImageFormat.Png)
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!