如何将图片加载入记忆体且如何将在记忆体内的图片show在视图上
如何将图片加载入记忆体
且如何将在记忆体内的图片
show在视图上
请问大侠们要怎实现呢??
谁可以提供程序让我学习…
问题点数:0、回复次数:2Top
1 楼tbwisess(精武门)回复于 2004-08-01 09:31:10 得分 0
//从书上抄的,不知道符合楼主要求不,我也是刚学 :)
void CBkGroundMapView::OnDraw(CDC* pDC)
{
CBkGroundMapDoc* pDoc=Getdocument();
ASSERT_VALID(pDoc);
CBitmap Bitmap;
Bitmap.LoadBitmap(IDB_BITMAP);
CDC MemDC;
MemDC.CreateCompatibleDC(pDC);
CBitmap* pOldBitmap=MemDC.SeletObject(&Bitmap);
BITMAP bmap;
Bitmap.GetObject(sizeof(BITMAP),&bmap);
pDC->BitBlt(0,0,bmap.bmWidth,bmap.bmHeight,&MemDC,0,0,SRCCOPY);
MemDC.SelectObject(pOldBitmap);
} Top
2 楼tbwisess(精武门)回复于 2004-08-01 09:37:40 得分 0
/////////////////////////////////////////////////////////////////////
Creates a memory device context that is compatible with the device specified by pDC.
BOOL CreateCompatibleDC(
CDC* pDC
);
////////////////////////////////////////////////////////////////////
Copies a bitmap from the source device context to this current device context.
BOOL BitBlt(
int x,
int y,
int nWidth,
int nHeight,
CDC* pSrcDC,
int xSrc,
int ySrc,
DWORD dwRop
);
Parameters
x
Specifies the logical x-coordinate of the upper-left corner of the destination rectangle.
y
Specifies the logical y-coordinate of the upper-left corner of the destination rectangle.
nWidth
Specifies the width (in logical units) of the destination rectangle and source bitmap.
nHeight
Specifies the height (in logical units) of the destination rectangle and source bitmap.
pSrcDC
Pointer to a CDC object that identifies the device context from which the bitmap will be copied. It must be NULL if dwRop specifies a raster operation that does not include a source.
xSrc
Specifies the logical x-coordinate of the upper-left corner of the source bitmap.
ySrc
Specifies the logical y-coordinate of the upper-left corner of the source bitmap.
dwRop
Specifies the raster operation to be performed. Raster-operation codes define how the GDI combines colors in output operations that involve a current brush, a possible source bitmap, and a destination bitmap. See BitBlt in the Platform SDK for a list of the raster-operation codes for dwRop and their descriptions
Top




