Search code examples
c++imageprintingwxwidgets

How do I print a wxImage with wxWidgets?


I am writing a program using wxWidgets and I need to print a wxImage object. How do I do this? Also, the image needs to be scaled to fill the whole available print area? I tried to find some information on google and found this.

However, I couldn't understand what to do based only on that page! Any help would be great!


Solution

  • If you need fine control over printing, you must define your own wxPrintout-derived class. The printing sample shows how to do it and you really need to explain what exactly is your problem to get more help with solving it.

    In many cases, using wxHtmlEasyPrinting can be enough, and is much easier -- but it won't take care of filling the image on its own, you will need to scale it yourself.