X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/fea35690f171f9677bd9f949c0af3dc16d1a9576..9e967d5417d49764276cf121a32c35d5770b1332:/docs/latex/wx/memorydc.tex diff --git a/docs/latex/wx/memorydc.tex b/docs/latex/wx/memorydc.tex index d2fddb79d1..e71262b954 100644 --- a/docs/latex/wx/memorydc.tex +++ b/docs/latex/wx/memorydc.tex @@ -15,6 +15,10 @@ foreground colour (i.e. 1). +\wxheading{Library} + +\helpref{wxCore}{librarieslist} + \wxheading{Remarks} A bitmap must be selected into the new memory DC before it may be used @@ -33,6 +37,16 @@ for anything. Typical usage is as follows: Note that the memory DC {\it must} be deleted (or the bitmap selected out of it) before a bitmap can be reselected into another memory DC. +And, before performing any other operations on the bitmap data, the bitmap must +be selected out of the memory DC: + +\begin{verbatim} + temp_dc.SelectObject(wxNullBitmap) +\end{verbatim} + +(this happens automatically when wxMemoryDC object goes out of scope). + + \wxheading{See also} \helpref{wxBitmap}{wxbitmap}, \helpref{wxDC}{wxdc} @@ -65,11 +79,13 @@ Works exactly like \helpref{SelectObjectAsSource}{wxmemorydcselectobjectassource this is the function you should use when you select a bitmap because you want to modify it, e.g. drawing on this DC. -Be careful to use this function and not \helpref{SelectObjectAsSource}{wxmemorydcselectobjectassource} -when you want to modify the bitmap you are selecting otherwise you may incurr in some -problems related to wxBitmap being a reference counted object +Using \helpref{SelectObjectAsSource}{wxmemorydcselectobjectassource} when modifying +the bitmap may incurr some problems related to wxBitmap being a reference counted object (see \helpref{reference counting overview}{trefcount}). +Also, before using the updated bitmap data, make sure to select it out of context first +(for example by selecting wxNullBitmap into the device context). + \wxheading{See also} \helpref{wxDC::DrawBitmap}{wxdcdrawbitmap} @@ -93,3 +109,4 @@ be destroyed safely. \wxheading{See also} \helpref{wxMemoryDC::SelectObject}{wxmemorydcselectobject} +