>>722 一部抜き出したので、これで勘弁。
procedure TSPI.GetBitmap(ms: TMemoryStream; bm: TBitmap);
var
hBmpInfo, hBitmap: HLOCAL;
pBmpInfo, pBitmap: Pointer;
BmpInfo: PBitmapInfo;
begin
GetPicture(ms.Memory, ms.Size, 1, hBmpInfo, hBitmap, nil, 0);
pBmpInfo := GlobalLock(hBmpInfo);
pBitmap := GlobalLock(hBitmap);
BmpInfo := pBmpInfo;
bm.Width := BmpInfo^.bmiHeader.biWidth;
bm.Height := BmpInfo^.bmiHeader.biHeight;
SetDiBits(bm.Canvas.Handle, bm.Handle, 0, BmpInfo^.bmiHeader.biHeight, pBitmap, BmpInfo^, DIB_RGB_COLORS );
GlobalUnlock(hBmpInfo);
GlobalUnlock(hBitmap);
GlobalFree(hBmpInfo);
GlobalFree(hBitmap);
end;