<% dim ModuleName,InfoID,ChannelShortName,CorrelativeArticle,InstallDir,ChannelDir,Keyword,PageTitle,ArticleIntro,Articlecontent Keyword=stripHTML("VC,BMP格式") PageTitle=stripHTML("VC把图存成BMP格式") ArticleIntro=stripHTML("") Articlecontent=stripHTML("int SaveBmp(HANDLE hData,LPSTR filename)  {  BITMAPFILEHEADER bfh;  BITMAPINFOHE…") ModuleName = stripHTML("programme") InfoID = stripHTML("114828") ChannelShortName=stripHTML("编程") InstallDir=stripHTML("http://www.77169.com/") ChannelDir=stripHTML("programme") %> VC把图存成BMP格式 - 华盟网 - http://www.77169.com
您现在的位置: 华盟网 >> 编程 >> Vc >> 正文

VC把图存成BMP格式

2012/3/22 作者:不详 来源: 华盟收集
导读 <% if len(ArticleIntro)<3 then Response.Write Articlecontent 'Response.Write "Articlecontent" else Response.Write ArticleIntro 'Response.Write "ArticleIntro" end if %>

  int SaveBmp(HANDLE hData,LPSTR filename)

  {

  BITMAPFILEHEADER bfh;

  BITMAPINFOHEADER *lpbi=(BITMAPINFOHEADER*)hData;

  bfh.bfType=0x4D42; //BM

  bfh.bfSize=sizeof(bfh)+GlobalSize(hData);

  bfh.bfReserved1=bfh.bfReserved2=0;

  int colors=1

  if(colors>256) colors=0;

  bfh.bfOffBits=sizeof(bfh)+lpbi->biSize+colors*sizeof(RGBQUAD);

  HANDLE hFile=CreateFile(filename,GENERIC_WRITE

  ,FILE_SHARE_READ|FILE_SHARE_WRITE,NULL,CREATE_ALWAYS,

  FILE_ATTRIBUTE_NORMAL,NULL);

  if(hFile)

  {

  DWORD write;

  WriteFile(hFile,&bfh,sizeof(bfh),&write,NULL);

  WriteFile(hFile,lpbi,GlobalSize(hData),&write,NULL);

  int i=sizeof(hData);

  CloseHandle(hFile);

  return true;

  }

  return false;

  }

 



  • 上一篇编程:

  • 下一篇编程: