It's possible but a little bit tricky
Code:
XGraphics gfx = XGraphics.FromPdfPage(p.Pages[0]);
Assembly a = Assembly.GetAssembly( typeof( Form1 ) );
Stream imgStream = a.GetManifestResourceStream( "Assembly.Resources.floating.png" );
XImage img = XImage.FromGdiPlusImage(Image.FromStream(imgStream));
const double dx = 250, dy = 140;
double width = img.PixelWidth * 72 / img.HorizontalResolution;
double height = img.PixelHeight * 72 / img.HorizontalResolution;
gfx.DrawImage(img, (dx - width) / 2, (dy - height) / 2, width, height);
First get the page where you want to place an embedded image.
Code:
XGraphics gfx = XGraphics.FromPdfPage(p.Pages[0]);
Next get the filestream from your assembly. You have to replace the resource string in GetManifestResourceStream. And check if all your images are really embedded resources. Check this link
http://www.attilan.com/2006/08/accessin ... rces_u.phpCode:
Assembly a = Assembly.GetAssembly( typeof( Form1 ) );
Stream imgStream = a.GetManifestResourceStream( "Aufnahme.Resources.floating.png" );
And last but not least, create a XImage. In WPF you could use FromBitmapSource. As i'm not using WPF you should try by yourself.
Code:
XImage img = XImage.FromGdiPlusImage(Image.FromStream(imgStream));
Now just choose the right dimensions for your image an place it in your document.
Code:
const double dx = 250, dy = 140;
double width = img.PixelWidth * 72 / img.HorizontalResolution;
double height = img.PixelHeight * 72 / img.HorizontalResolution;
gfx.DrawImage(img, (dx - width) / 2, (dy - height) / 2, width, height);