explain more clearly the possible usage scenarios
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@42415 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
61ecd22547
commit
4fa3f8c355
@ -11,23 +11,30 @@
|
|||||||
|
|
||||||
\section{\class{wxBufferedDC}}\label{wxbuffereddc}
|
\section{\class{wxBufferedDC}}\label{wxbuffereddc}
|
||||||
|
|
||||||
This simple class provides a simple way to avoid flicker: when drawing on it,
|
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
|
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
|
\helpref{wxBitmap}{wxbitmap}) and then copied to the screen, using the
|
||||||
object is destroyed.
|
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.
|
||||||
|
|
||||||
It can be used in the same way as any other device context. wxBufferedDC itself
|
When used like this, a valid \arg{dc} must be specified in the constructor
|
||||||
typically replaces \helpref{wxClientDC}{wxclientdc}, if you want to use it in
|
while the \arg{buffer} bitmap doesn't have to be explicitly provided, by
|
||||||
your \texttt{OnPaint()} handler, you should look at
|
default this class will allocate the bitmap of required size itself. However
|
||||||
\helpref{wxBufferedPaintDC}{wxbufferedpaintdc} or \helpref{wxAutoBufferedPaintDC}{wxautobufferedpaintdc}.
|
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.
|
||||||
|
|
||||||
Please note that GTK+ 2.0 as well as OS X provide double buffering themselves
|
There is another possible use for wxBufferedDC is to use it to maintain a
|
||||||
+natively. Use \helpref{wxWindow::IsDoubleBuffered}{wxwindowisdoublebuffered} to
|
backing store for the window contents. In this case, the associated \arg{dc}
|
||||||
+determine whether you need to use buffering or not.
|
may be \NULL but a valid backing store bitmap should be specified.
|
||||||
|
|
||||||
\wxheading{Localization Support}
|
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}
|
||||||
If you pass in a valid DC, wxBufferedDC will inherit its layout direction.
|
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}
|
\wxheading{Derived from}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user