title: Image generation
body: <p>I need to generate for each record image (combined from some images). I do it with canvas.</p>
  
  <pre><code>       html2canvas($("#target"), {
      onrendered: function(canvas) {
          var imgsrc = canvas.toDataURL("image/png");
          $("#img-data").val(canvas.toDataURL("image/png"));
          var extra_canvas = document.createElement("canvas");
          extra_canvas.setAttribute("width",240);
          extra_canvas.setAttribute("height",400);
          var ctx = extra_canvas.getContext("2d");
          ctx.drawImage(canvas,0,0,canvas.width, 
          canvas.height,0,0,240,400);
          var dataURL = extra_canvas.toDataURL();
  </code></pre>
  
  <p>Something like this.
  So in my action I can get content</p>
  
  <pre><code>$content = $this-&gt;renderPartial('renderings\test', ['model' =&gt; MyData::findOne($myData['data_id'])]);
  </code></pre>
  
  <p>but I will get the correct record after some time, so it's impossible to get data with using DOMDocument, or generating some html file for converting an image.</p>
  
  <p>I need to find some way for getting generated image src...</p>
  
  <p>Image generated by this code</p>
  
  <pre><code>  &lt;?php for ( $i = 1; $i &lt;= 6; $i++ ) { 
         if ( $i == 1 ) { ?&gt; 
              &lt;div class="panel"&gt;
          &lt;?php } ?&gt;
          &lt;div class="dd1&lt;?= $i; ?&gt; &lt;?php echo $previewPanelSize ?&gt;"&gt;
              &lt;?php
  
              if (($model-&gt;{'tem_p' . $i . '_type'} == '2') and ($model-&gt;{'tem_p' . $i . '_content'} &gt; 1500027946)) { // condition for projects that need the refnumber to display image, remove in case this changes
  
                  $im = Images::findOne(['ima_refnum' =&gt; $model-&gt;{'tem_p' . $i . '_content'}]);
                  if ($im) {
                      print '&lt;center id="' . $im-&gt;ima_refnum . '"&gt;' . Html::img('data:' . $im-&gt;ima_type . ';base64,' . $im-&gt;ima_image, []) . '&lt;/center&gt;';
                  }
              } else {
                  print '&lt;center&gt;' . $model-&gt;{'tem_p' . $i . '_content'} . '&lt;/center&gt;';
              }
              ?&gt;
          &lt;/div&gt;
          &lt;?php if ($i == 3 ) { ?&gt;
              &lt;/div&gt;
              &lt;div class="panel"&gt;
          &lt;?php } ?&gt;
          &lt;?php if ($i == 6 ) { ?&gt;
              &lt;/div&gt;
          &lt;?php } ?&gt;
      &lt;?php } ?&gt;
  </code></pre>
  
  <p>Any good idea?</p>