From: Vadim Zeitlin Date: Tue, 6 Mar 2012 14:19:29 +0000 (+0000) Subject: Mention the limitations of wxDC::GetPixel() and FloodFill() in wxGTK. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/72dc73023f4474d28d83e2cf6878cd310cd9648b Mention the limitations of wxDC::GetPixel() and FloodFill() in wxGTK. These methods can't be used directly on wxPaintDC in wxGTK and it doesn't seem possible to fix this so just document this limitation. Closes #14067. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70827 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/interface/wx/dc.h b/interface/wx/dc.h index eeeb907f6d..4089c9e389 100644 --- a/interface/wx/dc.h +++ b/interface/wx/dc.h @@ -707,6 +707,13 @@ public: @note The present implementation for non-Windows platforms may fail to find colour borders if the pixels do not match the colour exactly. However the function will still return @true. + + @note This method shouldn't be used with wxPaintDC under non-Windows + platforms as it uses GetPixel() internally and this may give + wrong results, notably in wxGTK. If you need to flood fill + wxPaintDC, create a temporary wxMemoryDC, flood fill it and then + blit it to, or draw as a bitmap on, wxPaintDC. See the example of + doing this in the drawing sample and wxBufferedPaintDC class. */ bool FloodFill(wxCoord x, wxCoord y, const wxColour& colour, wxFloodFillStyle style = wxFLOOD_SURFACE); @@ -1366,6 +1373,9 @@ public: @note Setting a pixel can be done using DrawPoint(). + @note This method shouldn't be used with wxPaintDC as accessing the DC + while drawing can result in unexpected results, notably in wxGTK. + @beginWxPythonOnly The wxColour value is returned and is not required as a parameter. @endWxPythonOnly