首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > .NET >

delphi 转 vc 有关问题

2012-03-04 
delphi 转 vc 问题delphi 6.0:code:Image.Picture.Bitmap.PixelFormat : pf24bitImage.Picture.Bitmap.W

delphi 转 vc 问题
delphi 6.0:
code:
  Image.Picture.Bitmap.PixelFormat := pf24bit;
  Image.Picture.Bitmap.Width := w;
  Image.Picture.Bitmap.Height:= h;
  GetImageBuffer(pointer(Image.Picture.Bitmap.scanline[h-1]), 24); //**.dll里面的函数
  SaveImage(pointer(Image.Picture.Bitmap.scanline[h-1]), w,h, 24, pchar(filename)); //**.dll里的函数

vc6.0: (菜鸟改的gdi)
code:
bitmap.bmHeight=h;
bitmap.bmWidth=w;
bitmap.bmBitsPixel=24;

BYTE* buff=new BYTE[w*h];
m_yy->GetImageBuffer((BYTE*)bitmap.bmBits,24);
m_yy->SaveImage((BYTE*)bitmap.bmBits,w,h,24,"dao.jpg");

但是不行,请大侠分析下.

[解决办法]
bitmap.bmHeight=h;
bitmap.bmWidth=w;
bitmap.bmBitsPixel=24;

BYTE* buff=new BYTE[w*h*3]; 
bitmap.GetBitmapBits(w * h * 3, buff);
m_yy->SaveImage(buff,w,h,24,"dao.jpg");

热点排行