title: RTF Picturescale
body: <p>so, I am editing rtf documents and adding somes images in them.</p>
  
  <p>I found this <a href="https://stackoverflow.com/questions/1490734/programatically-adding-images-to-rtf-document">topic</a> that help me adding the picture. But I do not understand, nor succeeding add it at the good scale.</p>
  
  <p>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. </p>
  
  <p>Here is what I do :</p>
  
  <pre><code>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 + "}";
  </code></pre>
  
  <p>(of course, I also tried <code>@"\picscaley100"</code>, same result)</p>
  
  <p>So basically, I just add the image, and specify the scale.</p>
  
  <p>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.</p>
  
  <p>It is obvisously not the good wsay, but I do not found example with a full line.</p>
  
  <p>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.</p>
  
  <pre><code>                    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);
  </code></pre>
  
  <p>And It can be a reason.</p>
  
  <p>Here are the differences, after modifiyng the scale with word : </p>
  
  <p><img src="https://i.stack.imgur.com/4W7NY.png" alt="pic1">
  <img src="https://i.stack.imgur.com/TAzn0.png" alt="pic2">
  <img src="https://i.stack.imgur.com/mldWB.png" alt="pic3"></p>