请问
CPaintDC dc(this); //CPaintDC是一个做什么的类 CBitmap bitmap; //CBitmap是一个做什么的类
bitmap.LoadBitmap (IDB_BKWOOD); CDC dcMem; //CDC是一个做什么的类
dcMem.CreateCompatibleDC(&dc);//CreateCompatibleDC是一个做什么的
//函数
CBitmap* pOldBitmap = dcMem.SelectObject(&bitmap);//这句话什么意
//意思? CRect rect(0 ,0, 0, 0);//CRect是做什么的类
GetClientRect(&rect); //这个函数是哪个类里面的,什么意思? dc.StretchBlt(0, 0, rect.Width(), rect.Height(), &dcMem,
0, 0, 640, 640, SRCCOPY);//这个函数什么意思?问题很菜,敬请指教
CPaintDC dc(this); //CPaintDC是一个做什么的类 CBitmap bitmap; //CBitmap是一个做什么的类
bitmap.LoadBitmap (IDB_BKWOOD); CDC dcMem; //CDC是一个做什么的类
dcMem.CreateCompatibleDC(&dc);//CreateCompatibleDC是一个做什么的
//函数
CBitmap* pOldBitmap = dcMem.SelectObject(&bitmap);//这句话什么意
//意思? CRect rect(0 ,0, 0, 0);//CRect是做什么的类
GetClientRect(&rect); //这个函数是哪个类里面的,什么意思? dc.StretchBlt(0, 0, rect.Width(), rect.Height(), &dcMem,
0, 0, 640, 640, SRCCOPY);//这个函数什么意思?问题很菜,敬请指教
解决方案 »
- CButtonST类关联了一个按钮控件,但是按钮上的文字没了!
- 怎么把vector对象中的内容赋给数组
- CRC16校验
- MDI程序中子窗口怎样能移动到主窗口客户区外面
- 问个控制台程序--如何打开D:\\data.txt
- 哪位大侠能介绍一下如何在vc6.0中使用DataGrid控件?
- 请问我在用ODBC连表时,如果表不存在为什么会报内存错误?
- 用Simple MAPI能否读取IMAP文件夹里的信?第四次发贴了,大侠们好歹给个话儿。
- 请问如何实现划词呢?(类似金山那样的划词翻译)
- 问个挨打的问题:用VC开发的同胞们用主要用它来开发什么样的程序?网络?数据库?还是别的。我觉得它不如Delphi方便呀。
- 请教使用CImageList控件的象棋棋子怎么样实现”透明位图”?
- 请教一个"标题具有五彩色变化的窗口"的VC++程序
The CPaintDC class is a device-context class derived from CDC. It performs a CWnd::BeginPaint at construction time and CWnd::EndPaint at destruction time. A CPaintDC object can only be used when responding to aWM_PAINT message, usually in your OnPaint message-handler member function.是由CDC派生的一个设备上下文类!
只响应WM_PAINT
CDC是一个做什么的类The CDC class defines a class of device-context objects. The CDC object provides member functions for working with a device context, such as a display or printer, as well as members for working with a display context associated with the client area of a window.
设备上下文类!
For specific uses, the Microsoft Foundation Class Library provides several classes derived from CDC . CPaintDC encapsulates calls to BeginPaint and EndPaint. CClientDC manages a display context associated with a window’s client area. CWindowDC manages a display context associated with an entire window, including its frame and controls. CMetaFileDC associates a device context with a metafile.具体还是看MSDN,希望楼主E语可以!
bitmap.LoadBitmap (IDB_BKWOOD); BOOL LoadBitmap( LPCTSTR lpszResourceName );BOOL LoadBitmap( UINT nIDResource );Return ValueNonzero if successful; otherwise 0.
Loads the bitmap resource named by lpszResourceName or identified by the ID number in nIDResource from the application’s executable file. The loaded bitmap is attached to the CBitmap object.装载bitmap资源,名为lpszResourceName ,或由ID确定的资源!
attache到CBitmap 对象上!CBitmap* pOldBitmap = dcMem.SelectObject(&bitmap);//这句话什么意
//意思?CDC::SelectObject
CPen* SelectObject( CPen* pPen );CBrush* SelectObject( CBrush* pBrush );virtual CFont* SelectObject( CFont* pFont );CBitmap* SelectObject( CBitmap* pBitmap );int SelectObject( CRgn* pRgn );Return ValueA pointer to the object being replaced. This is a pointer to an object of one of the classes derived from CGdiObject, such as CPen, depending on which version of the function is used. The return value is NULL if there is an error. This function may return a pointer to a temporary object. This temporary object is only valid during the processing of one Windows message. For more information, see CGdiObject::FromHandle.
就是设备选用了你自己定义的pBitmap ,把原来用的返回给你!