Hi
i have tried to put images in a docx with open xml
he creates the docx but no images are shown in the document
i use this code to put images:
grtz
GSharp69
i have tried to put images in a docx with open xml
he creates the docx but no images are shown in the document
i use this code to put images:
Code:
PackagePart partPicture = document.CreatePart(packageOutput, uriPicture, "image/jpeg");
using (Stream targetStream = partPicture.GetStream())
{
using (FileStream sourceStream = new FileStream(@"c:\Joker2.jpg",FileMode.Open, FileAccess.Read))
{
byte[] buffer = new byte[1024];
int nrBytesWritten = sourceStream.Read(buffer, 0, 1024);
while (nrBytesWritten > 0)
{
targetStream.Write(buffer, 0, nrBytesWritten);
nrBytesWritten = sourceStream.Read(buffer, 0, 1024);
}
}
}
grtz
GSharp69