/////////////////////////////////////////////////////////////////////////////////////////////// // paint routine void PixRasterBaseCtrl::Paint(Draw &d) { // clears background d.DrawRect(GetSize(), SColorFace()); // if no associated PixRaster, does nothing if(!pixRasterCtrl->GetPixBase()) return; // paints image inside cache, if needed PaintCache(); // paints image cache inside control if(imageCache.GetWidth() >= GetSize().cx) imageCache.Paint(d, Point(0, 0)); else imageCache.Paint(d, Point((GetSize().cx - imageCache.GetWidth()) / 2, 0)); // paints markers inside control PaintMarkers(d); // if dragging, paints rubber banded polygon if(selectedMarker && dragPolygon.GetCount()) { d.DrawPolygon(dragPolygon, dragPolygon.GetCount(), selectedMarker->GetFillColor(), selectedMarker->GetBorderThickness(), selectedMarker->GetBorderColor(), PEN_DOT, White); } } // END LeptonicaBaseCtrl::Paint()
void AudioDisplay::OnPaint(wxPaintEvent&) { if (!audio_renderer_provider) return; wxAutoBufferedPaintDC dc(this); wxRect audio_bounds(0, audio_top, GetClientSize().GetWidth(), audio_height); bool redraw_scrollbar = false; bool redraw_timeline = false; for (wxRegionIterator region(GetUpdateRegion()); region; ++region) { wxRect updrect = region.GetRect(); redraw_scrollbar |= scrollbar->GetBounds().Intersects(updrect); redraw_timeline |= timeline->GetBounds().Intersects(updrect); if (audio_bounds.Intersects(updrect)) { TimeRange updtime( std::max(0, TimeFromRelativeX(updrect.x - foot_size)), std::max(0, TimeFromRelativeX(updrect.x + updrect.width + foot_size))); PaintAudio(dc, updtime, updrect); PaintMarkers(dc, updtime); PaintLabels(dc, updtime); } } if (track_cursor_pos >= 0) { PaintTrackCursor(dc); } if (redraw_scrollbar) scrollbar->Paint(dc, HasFocus()); if (redraw_timeline) timeline->Paint(dc); }