X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/64e4759f438bbb39e9f8e86b753762c8b370c416..066f3611df971be93b2ec46b82c2f05f3ff9a422:/docs/latex/wx/bufferdc.tex diff --git a/docs/latex/wx/bufferdc.tex b/docs/latex/wx/bufferdc.tex index 57665f8e4a..4722c6a531 100644 --- a/docs/latex/wx/bufferdc.tex +++ b/docs/latex/wx/bufferdc.tex @@ -11,23 +11,30 @@ \section{\class{wxBufferedDC}}\label{wxbuffereddc} -This simple class provides a simple way to avoid flicker: when drawing on it, -everything is in fact first drawn on an in-memory buffer (a -\helpref{wxBitmap}{wxbitmap}) and then copied to the screen only once, when this -object is destroyed. - -It can be used in the same way as any other device context. wxBufferedDC itself -typically replaces \helpref{wxClientDC}{wxclientdc}, if you want to use it in -your \texttt{OnPaint()} handler, you should look at -\helpref{wxBufferedPaintDC}{wxbufferedpaintdc} or \helpref{wxAutoBufferedPaintDC}{wxautobufferedpaintdc}. - -Please note that GTK+ 2.0 as well as OS X provide double buffering themselves -+natively. Use \helpref{wxWindow::IsDoubleBuffered}{wxwindowisdoublebuffered} to -+determine whether you need to use buffering or not. - -\wxheading{Localization Support} - -If you pass in a valid DC, wxBufferedDC will inherit its layout direction. +This class provides a simple way to avoid flicker: when drawing on it, +everything is in fact first drawn on an in-memory buffer (a +\helpref{wxBitmap}{wxbitmap}) and then copied to the screen, using the +associated wxDC, only once, when this object is destroyed. wxBufferedDC itself +is typically associated with \helpref{wxClientDC}{wxclientdc}, if you want to +use it in your \texttt{EVT\_PAINT} handler, you should look at +\helpref{wxBufferedPaintDC}{wxbufferedpaintdc} instead. + +When used like this, a valid \arg{dc} must be specified in the constructor +while the \arg{buffer} bitmap doesn't have to be explicitly provided, by +default this class will allocate the bitmap of required size itself. However +using a dedicated bitmap can speed up the redrawing process by eliminating the +repeated creation and destruction of a possibly big bitmap. Otherwise, +wxBufferedDC can be used in the same way as any other device context. + +There is another possible use for wxBufferedDC is to use it to maintain a +backing store for the window contents. In this case, the associated \arg{dc} +may be \NULL but a valid backing store bitmap should be specified. + +Finally, please note that GTK+ 2.0 as well as OS X provide double buffering +themselves natively. You can either use \helpref{wxWindow::IsDoubleBuffered}{wxwindowisdoublebuffered} +to determine whether you need to use buffering or not, or use +\helpref{wxAutoBufferedPaintDC}{wxautobufferedpaintdc} to avoid needless double +buffering on the systems which already do it automatically. \wxheading{Derived from} @@ -39,6 +46,10 @@ If you pass in a valid DC, wxBufferedDC will inherit its layout direction. +\wxheading{Library} + +\helpref{wxCore}{librarieslist} + \wxheading{See also} \helpref{wxDC}{wxdc},\rtfsp @@ -55,7 +66,7 @@ If you pass in a valid DC, wxBufferedDC will inherit its layout direction. \func{}{wxBufferedDC}{\param{wxDC *}{dc}, \param{const wxSize\& }{area}, \param{int }{style = wxBUFFER\_CLIENT\_AREA}} -\func{}{wxBufferedDC}{\param{wxDC *}{dc}, \param{const wxBitmap\& }{buffer}, \param{int }{style = wxBUFFER\_CLIENT\_AREA}} +\func{}{wxBufferedDC}{\param{wxDC *}{dc}, \param{wxBitmap\& }{buffer}, \param{int }{style = wxBUFFER\_CLIENT\_AREA}} If you use the first, default, constructor, you must call one of the \helpref{Init}{wxbuffereddcinit} methods later in order to use the object. @@ -86,7 +97,7 @@ device context).} \func{void}{Init}{\param{wxDC *}{dc}, \param{const wxSize\& }{area}, \param{int }{style = wxBUFFER\_CLIENT\_AREA}} -\func{void}{Init}{\param{wxDC *}{dc}, \param{const wxBitmap\& }{buffer}, \param{int }{style = wxBUFFER\_CLIENT\_AREA}} +\func{void}{Init}{\param{wxDC *}{dc}, \param{wxBitmap\& }{buffer}, \param{int }{style = wxBUFFER\_CLIENT\_AREA}} These functions initialize the object created using the default constructor. Please see \helpref{constructors documentation}{wxbuffereddcctor} for details. @@ -125,6 +136,10 @@ already does this internally for the real underlying wxPaintDC. +\wxheading{Library} + +\helpref{wxCore}{librarieslist} + \wxheading{See also} \helpref{wxDC}{wxdc},\rtfsp @@ -136,7 +151,7 @@ already does this internally for the real underlying wxPaintDC. \membersection{wxBufferedPaintDC::wxBufferedPaintDC}\label{wxbufferedpaintdcctor} -\func{}{wxBufferedPaintDC}{\param{wxWindow *}{window}, \param{const wxBitmap\& }{buffer}, \param{int }{style = wxBUFFER\_CLIENT\_AREA}} +\func{}{wxBufferedPaintDC}{\param{wxWindow *}{window}, \param{wxBitmap\& }{buffer}, \param{int }{style = wxBUFFER\_CLIENT\_AREA}} \func{}{wxBufferedPaintDC}{\param{wxWindow *}{window}, \param{int }{style = wxBUFFER\_CLIENT\_AREA}} @@ -173,7 +188,8 @@ a typedef of wxPaintDC. Otherwise, it is a typedef of wxBufferedPaintDC. \wxheading{Derived from} \helpref{wxBufferedPaintDC}{wxbufferedpaintdc}\\ -\helpref{wxPaintDC}{wxpaintdc}\\ +\helpref{wxBufferedDC}{wxbuffereddc}\\ +\helpref{wxMemoryDC}{wxmemorydc}\\ \helpref{wxDC}{wxdc}\\ \helpref{wxObject}{wxobject}