ststeiger / PdfSharpCore

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

.AddImage with Imagesource #398

Closed tossnet closed 10 months ago

tossnet commented 10 months 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 10 months ago

I was missing those lines before :

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