title: wxWidgets: Frame size is not changing in Image panel
body: <p>I am using wxWidgets 'An Image Panel' code. Here I made only one change.
  I want frame size should be equal to image size, My Image size is 762x463, but my frame size is different. frame SetSize function is not working.</p>
  <pre><code>wxImagePanel::wxImagePanel(wxFrame* parent, wxString file, wxBitmapType format) :
  wxPanel(parent)
  {
      image.LoadFile(file, format);
  }
  
  void wxImagePanel::paintEvent(wxPaintEvent &amp; evt)
  {
      // depending on your system you may need to look at double-buffered dcs
      wxPaintDC dc(this);
      render(dc);
  }
  
  void wxImagePanel::paintNow()
  {
      // depending on your system you may need to look at double-buffered dcs
      wxClientDC dc(this);
      render(dc);
  }
  
  void wxImagePanel::render(wxDC&amp;  dc)
  {
      dc.DrawBitmap( image, 0, 0, false );
  }
  
  class MyApp: public wxApp
      {
          
          wxFrame *frame;
          wxImagePanel * drawPane;
      public:
          bool OnInit()
          {
              // make sure to call this first
              wxInitAllImageHandlers();
              
              wxBoxSizer* sizer = new wxBoxSizer(wxHORIZONTAL);
              wxBitmap image(wxT(&quot;properties.png&quot;), wxBITMAP_TYPE_PNG);
              frame = new wxFrame(NULL, wxID_ANY, wxT(&quot;Hello wxDC&quot;), wxPoint(50,50), wxSize(image.GetWidth(), image.GetHeight()));  // 762x463
              
              // then simply create like this
              drawPane = new wxImagePanel( frame, wxT(&quot;image.jpg&quot;), wxBITMAP_TYPE_JPEG);
              sizer-&gt;Add(drawPane, 1, wxEXPAND);
              
              frame-&gt;SetSizer(sizer);
              
              frame-&gt;Show();
              return true;
          } 
          
      };
  </code></pre>