# 请问如何把图画(BMP)直接读进记忆体里??

Posted by RPG之鬼 on July 09, 1998 at 09:12:35:

通常使用LoadPicture把图画读进Picture Box 或Image Box 或Form
现在我想把图画直接读进记忆体里，但不要经过Picture Box 或Image Box 或Form
应该如何做??

现在我只懂得这样写：

hTempDC = CreateCompatibleDC(Picture1.hdc)
hBitmap = CreateCompatibleBitmap(Picture1.hdc, Picture1.Width, Picture1.Height)
hTempOld = SelectObject(hTempDC, hBitmap)
Picture1 = LoadPicture("c:\windows\bubbles.bmp")
b = BitBlt(hTempDC, 0, 0, Picture2.Width, Picture2.Height, Picture1.hdc, 0, 0, &HCC0020)
b = BitBlt(Picture2.hdc, 0, 0, Picture2.Width, Picture2.Height, hBitmap, 0, 0, &HCC0020)

从上可知我先把图画读进Picture1之后把Picture1读进hTempDC
最后读进Picture2
我曾经这样写:
hTempDC = LoadPicture("c:\windows\bubbles.bmp")
b = BitBlt(Picture2.hdc, 0, 0, Picture2.Width, Picture2.Height, hBitmap, 0, 0, &HCC0020)
但Picture2什么也没有
有什么方法可以把图画直接读进hTempDC呢?

Follow Ups:

- Re: 请问如何把图画(BMP)直接读进记忆体里?? cww 11:39:54 7/09/98 (0)