- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
创建位图(create a bitmap)
创建位图(create a bitmap)
无效cmybmpview::OnDraw(CDC * PDC)
{
cmybmpdoc * PDOC = getdocument();
assert_valid(PDOC);
//为本地数据添加绘图代码
/////////////////////////////////////////////////
字节m_data [ 6 ] [ 12 ] = {
0,0255255,0,0,0,0255255,0,0,
0,0255255,0,0,0,0255255,0,0,
0,0255255,0,0,0,0255255,0,0,
0,0255255,0,0,0,0255255,0,0,
0,0255255,0,0,0,0255255,0,0,
0,0255255,0,0,0,0255255,0,0 };
/ * unsigned char m_data [ 6 ] [ 6 ];
对于(QQ = 0;QQ 6;QQ = 2)
{
对于(int=0;pp<6;pp ++)
{
如果(QQ % = 2 = 0)
{
m_data [ ] [ ] = 0 PP的QQ;
}
其他的
m_data [ ] [ ] = 255 PP的QQ;
}
}
* /长高度= 6;
/ /字color_num = 2;
字color_num = 256;
// int mimgdata = 6 *((6 * 1/8 + 3)/ 4 * 4);
国际mimgdata = 72;
lpbitmapinfo LPMF =(BITMAPINFO *)新字符[ sizeof(位图信息头结构)+ 256 * sizeof(颜色表项)];
LPMF - bmiheader.bisize = 40;
LPMF - bmiheader.biwidth = 12;
LPMF - bmiheader.biheight = 6;
LPMF - bmiheader.biplanes = 1;
/ / LPMF - bmiheader.bibitcount = 1;
LPMF - bmiheader.bibitcount = 8;
LPMF - bmiheader.bicompression = 0;
LPMF - bmiheader.bisizeimage = 72;
LPMF - bmiheader.bixpelspermeter = 0;
LPMF - bmiheader.biypelspermeter = 0;
LPMF - bmiheader.biclrused = 0;
LPMF - bmiheader.biclrimportant = 0;
int i;
对于(i = 0;i 255;i +)
{
LPMF - bmicolors [我]图像=(0字节);
LPMF - bmicolors [我]。rgbgreen =(0字节);
LPMF - bmicolors [我]。rgbblue =(0字节);
LPMF - bmicolors [我]。rgbreserved =(0字节);
}
如果(i = 255)
{
LPMF - bmicolors [我]图像=(255字节);
LPMF - bmicolors [我]。rgbgreen =(255字节);
LPMF - bmicolors [我]。rgbblue =(255字节);
LPMF - bmicolors [我]。rgbreserved =(0字节);
}
///////////////////////////////////////////////////////////
/ / /如果有颜色表,则创建调色板,hpalette为新创建的调色板句柄,
/ / holdpal旧的调色板句柄
hpalette hpalette = 0,holdpal;
如果(color_num!= 0){
/ /定义颜色表指针pcolortable,指向DIB的颜色表
颜色表项* pcolortable =(颜色表项*)(LPMF +
sizeof(位图信息头结构));
/ /申请空间,生成logpalette结构
lplogpalette plogpal =(lplogpalette)新字符[ 2 * sizeof(字)
+ color_num * sizeof(paletteentry)];
plogpal - palversion = 0 - x300;
plogpal - palnumentries = color_num;
为(int i = 0;i color_num;i++){
plogpal - palpalentry [我],[我]脾气= pcolortable图
您可能关注的文档
- 5大种族的终极技能评测(Ultimate skills assessment of the 5 races).doc
- 51现调站小吃(51, the current station snack).doc
- 5招巩固职场新人管理的职场地位(The 5 trick is to strengthen the workplace management status of the new workplace).doc
- 32位cup寄存器说明(32 bit cup register description).doc
- 5日共63人答辩安排 - 南京师范大学国际文化教育学院(5, 63 respondent arrangements - Nanjing Normal University International Cultural Institute of Education).doc
- 6.1课程(6.1 Curriculum).doc
- 60条令你大吃一惊的小常识92280(60 tips you 92280 be startled at doctrine).doc
- 68-苏州市吴中区2009(68- Suzhou, Wuzhong District 2009).doc
- 6601-四川省2005年10月高等教育自学考试—教育学a(6601- a higher education self taught Examination in Sichuan province October 2005 - Pedagogy).doc
- 69种小吃(69 kinds of snacks).doc
- 刀剑 攻略(Sword introduction).doc
- 创建工人先锋号经验材料(Create worker pioneer experience materials).doc
- 创意总监(Creative director).doc
- 创意是一种能量的开释管理(Creativity is a management of the release of energy).doc
- 创意英国的营销突围(Marketing breakthrough of creative Britain).doc
- 创新中国的驱动力量(Driving force of innovation in China).doc
- 创新之道教育化经营(The way of innovation Education Management).doc
- 创新激发无限活力(Innovation stimulates boundless vitality).doc
- 创新战略 在高成本灾难中涅盘(Innovation strategy nirvana in the high cost of disaster).doc
- 初一年立定跳远教学设计(The teaching design of standing long jump in the first year of junior high school).doc
文档评论(0)