|
|
我在网上也找不到关于SelectPen的说明,DeletePen也是这样
作者用的是Visual Studio 2003.net,我用的是6.0,是不是和版本有关系?
// 画线
void CGDISurface: ine( int x1, int y1, int x2, int y2, COLORREF c )
{
HPEN hPen = CreatePen(PS_SOLID, 1, c );
//HPEN hOldPen = SelectPen( m_hDC, hPen );
HPEN hOldPen = SelectPen( m_hDC, hPen );
MoveToEx( m_hDC, x1, y1, (LPPOINT) NULL );
LineTo( m_hDC, x2, y2 );
SelectPen( m_hDC, hOldPen );
DeletePen( hPen );
}
还有传送位图这一段
E:\C project\abc001\GDISurface.cpp(204) : error C2061: syntax error : identifier 'BltMode'
E:\C project\abc001\GDISurface.cpp(205) : error C2511: 'Blt' : overloaded member function 'void (class CGDISurface *,int,int,int,int,int,int)' not found in 'CGDISurface'
e:\c project\abc001\gdisurface.h(10) : see declaration of 'CGDISurface'
实在看不懂
GDISurface.h
// 位图传送
void Blt( CGDISurface *pSurface, int x, int y, int rx, int ry, int w, int h, SurfaceBltMode sbmMode );
GDISurface.cpp:
// 位图传送
void CGDISurface::Blt( CGDISurface *pSurface, int x, int y, int rx, int ry, int w, int h, BltMode iMode )
{
HDC hdcDst = pSurface->GetDC();
switch( iMode )
{
case BLT_BLOCK:
// 基本复制方式传送位图
BitBlt( hdcDst, x, y, w, h, m_hDC, rx, ry, SRCCOPY );
break;
case BLT_ALPHATEST:
// 带透明色方式传送位图
SetBkColor( hdcDst, RGB(255,255,255) );
SetTextColor( hdcDst, RGB(0,0,0) );
BitBlt( hdcDst, x, y, w, h, m_hMaskDC, rx, ry, SRCAND );
BitBlt( hdcDst, x, y, w, h, m_hDC, rx, ry, SRCPAINT );
break;
case BLT_ALPHABLEND:
break;
}
}
|
|