大雀软件园

首页 软件下载 安卓市场 苹果市场 电脑游戏 安卓游戏 文章资讯 驱动下载
技术开发 网页设计 图形图象 数据库 网络媒体 网络安全 站长CLUB 操作系统 媒体动画 安卓相关
当前位置: 首页 -> 技术开发 -> 程序开发 -> VC怎样把一副自己画的图存成BMP格式

VC怎样把一副自己画的图存成BMP格式

时间: 2021-07-31 作者:daque

int savebmp(handle hdata,lpstr filename){bitmapfileheader bfh;bitmapinfoheader *lpbi=(bitmapinfoheader*)hdata;bfh.bftype=0x4d42; //bmbfh.bfsize=sizeof(bfh)+globalsize(hdata);bfh.bfreserved1=bfh.bfreserved2=0;int colors=1<bibitcount;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; }

热门阅览

最新排行

Copyright © 2019-2021 大雀软件园(www.daque.cn) All Rights Reserved.