已知 bitmapinfoheader 和 图像数据,循环显示。
应该用什么方法显示?我用的tmemorystreat + image 就是不出图像。
推荐阅读
要把bitmapinfoheader 转成bitmapfileheader才能显示
我有已知bitmapinfoheader写成bitmap文件的例子,你可参考一下:
bool tmygraph::writedib(lptstr szfile, handle hdib, long size)
{
bitmapfileheader hdr;
lpbitmapinfoheader lpbi;
if (!hdib)
return false;
file* file=0;
file = fopen(szfile,"wb");
if(!file)
return false;
lpbi = (lpbitmapinfoheader)hdib;
int ncolors = 1 << lpbi->bibitcount;
if (ncolors > 256)
ncolors = 0;
hdr.bftype = ((word) (m << 8) | b); // is always "bm"
hdr.bfsize =/* globalsize (hdib) + */sizeof( hdr );
hdr.bfsize = size + sizeof( hdr );
hdr.bfreserved1 = 0;
hdr.bfreserved2 = 0;
hdr.bfoffbits = (dword) (sizeof( hdr ) + lpbi->bisize +
ncolors * sizeof(rgbquad)); // write the file header
fwrite(&hdr, 1, sizeof(hdr),file); // write the dib header and the bits
fwrite(lpbi, 1, size ,file);
fclose(file);
return true;
}
用timage的话,直接用image->picture->loadfromfile(bmpfilename);就可以显示了。
.

讨论区