ststeiger / PdfSharpCore

Port of the PdfSharp library to .NET Core - largely removed GDI+ (only missing GetFontData - which can be replaced with freetype2)
Other
1.08k stars 237 forks source link

.AddImage with Imagesource #398

Closed tossnet closed 1 year ago

tossnet commented 1 year ago

I've seen many examples where the path to an image was used directly for AddImage : .AddImage("/images/logo.jpg") Can someone show me how to use ImageSource? Capture d'écran 2023-10-12 112303

tossnet commented 1 year ago

I was missing those lines before :

 ImageSource.ImageSourceImpl ??= new ImageSharpImageSource<Rgba32>();
var  image = ImageSource.FromFile(_imagefile);