C
Ok Problem gelöst. Falls es jemanden interessiert hier der Code der funzut:
void wxImagePanel::paintEvent(wxPaintEvent & evt)
{
// depending on your system you may need to look at double-buffered dcs
wxBufferedPaintDC 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& dc)
{
PrepareDC(dc);
//PaintBackground(dc);
int neww, newh;
this->GetSize( &neww, &newh );
resized = wxBitmap( image.Scale( neww, newh /*, wxIMAGE_QUALITY_HIGH*/ ) );
dc.DrawBitmap( resized, 0, 0, true );
}
void wxImagePanel::OnSize(wxSizeEvent& event)
{
Refresh();
//skip the event.
event.Skip();
}
void wxImagePanel::button1()
{
image=image.Rotate90();
paintNow();
Refresh();
}
void wxImagePanel::PaintBackground(wxDC& dc)
{
wxColour backgroundColour = GetBackgroundColour();
if (!backgroundColour.Ok())
backgroundColour = wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE);
dc.SetBrush(wxBrush(backgroundColour));
dc.SetPen(wxPen(backgroundColour, 1));
wxRect windowRect(wxPoint(0, 0), GetClientSize());
dc.DrawRectangle(windowRect);
}
// Empty implementation, to prevent flicker
void wxImagePanel::OnEraseBackground(wxEraseEvent& event)
{
}
gruz caaso