title: Delphi: Export/Draw TPaintbox straight to file with custom image size
body: <p>I have subclassed <code>ExtCtrls.TPaintBox</code> with several help functions and overridden the <code>Paint</code> method. I can add a <code>TPaintBox</code> to a form which then acts as my custom paintbox object and draws the desired output.</p>
  
  <p>Now I want to draw (write) the contents of my paintbox to a file, but with different dimensions; e.g. inside the UI of my application the paintbox has size 150x600 (width x height), but when drawing to the file, I need it to be larger.</p>
  
  <p>I want to be able to reuse my drawing code (= <code>TPaintBox.Paint</code>) and virtually draw it to <code>an object</code> and then save that object to a file.</p>
  
  <p>I'm already able to export it, but resizing on export makes the image look like you would enlarge it with paint.</p>