so, I am editing rtf documents and adding somes images in them.
I found this topic that help me adding the picture. But I do not understand, nor succeeding add it at the good scale.
It is add, with default a scale of 6, but even if I try adding a scale 100, it doesn't work and still at 6.
Here is what I do :
string mpic = @"{\pict\jpegblip\picw" +
returnImage.Width.ToString() + @"\pich" + returnImage.Height.ToString() +
@"\picwgoal" + returnImage.Width.ToString() + @"\pichgoal" + returnImage.Height.ToString() +
@"\picscalex" + 100.ToString() + @"\picscaley" + 100.ToString() +
@"\hex " + str + "}";
(of course, I also tried @"\picscaley100"
, same result)
So basically, I just add the image, and specify the scale.
I read that it is a 100% as default, but when I do not a the scale, it still 6 %, and when I add the scale, no changement.
It is obvisously not the good wsay, but I do not found example with a full line.
I think I forgot an important part : this string, replace another string in the document. And the document, I s covnert from byte to a string, so that I can modifiy my document.
using (var file = new MemoryStream(text))
using (var reader = new StreamReader(file))
{
//on se place au début du document à lire
reader.BaseStream.Seek(0, SeekOrigin.Begin);
//tant que la lecture n'est pas rendu à la fin du document on continue
while (!reader.EndOfStream)
{
//ecriture de chaque ligne du byte dans une string
contenu += reader.ReadLine();
}
}
myString.Replace("myImage", mpic);
And It can be a reason.
Here are the differences, after modifiyng the scale with word :