X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/dcbd177f06597f98aae27bf53a4c98b4739102c7..dc484d491b15355285a89da275c58c2ef247d1f4:/docs/latex/wx/memorydc.tex?ds=inline diff --git a/docs/latex/wx/memorydc.tex b/docs/latex/wx/memorydc.tex index 0f4f2854c6..c3e4f16ce9 100644 --- a/docs/latex/wx/memorydc.tex +++ b/docs/latex/wx/memorydc.tex @@ -45,21 +45,52 @@ can be reselected into another memory DC. Constructs a new memory device context. -Use the {\it Ok} member to test whether the constructor was successful -in creating a usable device context. Don't forget to select a bitmap -into the DC before drawing on it. +Use the \helpref{IsOk}{wxdcisok} member to test whether the constructor was successful +in creating a usable device context. +Don't forget to select a bitmap into the DC before drawing on it. + +\func{}{wxMemoryDC}{\param{wxBitmap\& }{bitmap}} + +Constructs a new memory device context and calls \helpref{SelectObject}{wxmemorydcselectobject} +with the given bitmap. +Use the \helpref{IsOk}{wxdcisok} member to test whether the constructor was successful +in creating a usable device context. + \membersection{wxMemoryDC::SelectObject}\label{wxmemorydcselectobject} -\func{}{SelectObject}{\param{const wxBitmap\& }{bitmap}} +\func{void}{SelectObject}{\param{wxBitmap\& }{bitmap}} + +Works exactly like \helpref{SelectObjectAsSource}{wxmemorydcselectobjectassource} but +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 +(see \helpref{reference counting overview}{trefcount}). + +\wxheading{See also} + +\helpref{wxDC::DrawBitmap}{wxdcdrawbitmap} + + + +\membersection{wxMemoryDC::SelectObjectAsSource}\label{wxmemorydcselectobjectassource} + +\func{void}{SelectObjectAsSource}{\param{const wxBitmap\& }{bitmap}} Selects the given bitmap into the device context, to use as the memory bitmap. Selecting the bitmap into a memory DC allows you to draw into -the DC (and therefore the bitmap) and also to use {\bf Blit} to copy +the DC (and therefore the bitmap) and also to use \helpref{wxDC::Blit}{wxdcblit} to copy the bitmap to a window. For this purpose, you may find \helpref{wxDC::DrawIcon}{wxdcdrawicon}\rtfsp easier to use instead. -If the argument is wxNullBitmap (or some other uninitialised wxBitmap) the current bitmap is selected out of the device -context, and the original bitmap restored, allowing the current bitmap to +If the argument is wxNullBitmap (or some other uninitialised wxBitmap) the current bitmap is +selected out of the device context, and the original bitmap restored, allowing the current bitmap to be destroyed safely. +\wxheading{See also} + +\helpref{wxMemoryDC::SelectObject}{wxmemorydcselectobject} +