⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 memorydc.tex

📁 很牛的GUI源码wxWidgets-2.8.0.zip 可在多种平台下运行.
💻 TEX
字号:
\section{\class{wxMemoryDC}}\label{wxmemorydc}A memory device context provides a means to draw graphics onto a bitmap. Whendrawing in to a mono-bitmap, using {\tt wxWHITE}, {\tt wxWHITE\_PEN} and{\tt wxWHITE\_BRUSH}will draw the background colour (i.e. 0) whereas all other colours will draw theforeground colour (i.e. 1).\wxheading{Derived from}\helpref{wxDC}{wxdc}\\\helpref{wxObject}{wxobject}\wxheading{Include files}<wx/dcmemory.h>\wxheading{Remarks}A bitmap must be selected into the new memory DC before it may be usedfor anything.  Typical usage is as follows:\begin{verbatim}  // Create a memory DC  wxMemoryDC temp_dc;  temp_dc.SelectObject(test_bitmap);  // We can now draw into the memory DC...  // Copy from this DC to another DC.  old_dc.Blit(250, 50, BITMAP_WIDTH, BITMAP_HEIGHT, temp_dc, 0, 0);\end{verbatim}Note that the memory DC {\it must} be deleted (or the bitmap selected out of it) before a bitmapcan be reselected into another memory DC.\wxheading{See also}\helpref{wxBitmap}{wxbitmap}, \helpref{wxDC}{wxdc}\latexignore{\rtfignore{\wxheading{Members}}}\membersection{wxMemoryDC::wxMemoryDC}\label{wxmemorydcctor}\func{}{wxMemoryDC}{\void}Constructs a new memory device context.Use the \helpref{IsOk}{wxdcisok} member to test whether the constructor was successfulin 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 successfulin creating a usable device context.\membersection{wxMemoryDC::SelectObject}\label{wxmemorydcselectobject}\func{void}{SelectObject}{\param{wxBitmap\& }{bitmap}}Works exactly like \helpref{SelectObjectAsSource}{wxmemorydcselectobjectassource} butthis is the function you should use when you select a bitmap because you want to modifyit, 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 someproblems 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 memorybitmap. Selecting the bitmap into a memory DC allows you to draw intothe DC (and therefore the bitmap) and also to use \helpref{wxDC::Blit}{wxdcblit} to copythe bitmap to a window. For this purpose, you may find \helpref{wxDC::DrawIcon}{wxdcdrawicon}\rtfspeasier to use instead.If the argument is wxNullBitmap (or some other uninitialised wxBitmap) the current bitmap isselected out of the device context, and the original bitmap restored, allowing the current bitmap tobe destroyed safely.\wxheading{See also}\helpref{wxMemoryDC::SelectObject}{wxmemorydcselectobject}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -