I have designed a selection box using a transparent background and dc.DrawRectangle();
It works well however the real goal is to make a Photoshop/Imageready selection box on top of an image, however i am running into a problem when the screen renders.
The selection box is ending up behind the image like so.

I am using the following code to make it all happen. (Note the TGA class is just one of many i have tried as far as images goes, the same happens with png, jpg, etc..)
Code: Select all
void Canvas::Draw(wxDC& dc)
{
TGAImg *tga = new TGAImg();
tga->Load("Layout.tga");
wxImage img(tga->GetWidth(),tga->GetHeight(),tga->GetImg(),0,true);
dc.DrawBitmap(wxBitmap(img),wxPoint(100,100));
}
Code: Select all
void Canvas::OnPaint(wxPaintEvent &WXUNUSED(event))
{
wxPaintDC dc(this);
PrepareDC(dc);
m_parent->PrepareDC(dc);
dc.SetBrush(*wxTRANSPARENT_BRUSH);
dc.SetPen( wxPen( wxT("black"), 1, wxSOLID) );
dc.DrawRectangle(origin,wxSize(delta.x,delta.y));
Draw();
}
If anyone has any insight as to why its doing this and how i can fix it, I would really appriciate it.