Ok so I have been trying to figure this out all day, and I'm sure it will end up being very simple and something I've just overlooked but I don't really know where else to turn.
I've been working off info from tutorials and sites, mainly
http://wiki.wxwidgets.org/An_image_panel
And I have that working, the only problem is it displays the picture in a new frame. I need to put the picture in an area within an existing frame, eventually on the click of a button it will go to the next picture in an array of locations being passed to the form by my c++ code but I have that sorted out.
I just need to know how to place the picture into my existing form and display it there, rather than a separate window.
Any guidance would be appreciated.
Displaying Pictures
Re: Displaying Pictures
There is a wxStaticBitmap class. Put the wxStaticBitmap where you want it in your frame and set an image for it. You can set the image from your code. You can change the image when you want. If you are using some kind of "GUI designer" and resource files then you can specify the image in the resource file. Sure, you can change the image later.
Re: Displaying Pictures
I tried using that, I had problems getting it to resize properly. Also I read it should be used more for small images and icons, especially on Windows.
Re: Displaying Pictures
The wiki example you pointed to just draws into a panel. You are free to place that panel wherever you want.
this is the part where the panel is added to the sample frame. Adapt as you need.
Code: Select all
// make sure to call this first
wxInitAllImageHandlers();
wxBoxSizer* sizer = new wxBoxSizer(wxHORIZONTAL);
frame = new wxFrame(NULL, wxID_ANY, wxT("Hello wxDC"), wxPoint(50,50), wxSize(800,600));
// then simply create like this
drawPane = new wxImagePanel( frame, wxT("image.jpg"), wxBITMAP_TYPE_JPEG);
sizer->Add(drawPane, 1, wxEXPAND);
frame->SetSizer(sizer);
frame->Show();
return true;
"Keyboard not detected. Press F1 to continue"
-- Windows
-- Windows