找回密码
 立即注册

《VC++高级编程》

[复制链接]
发表于 2022-9-22 10:12:58 | 显示全部楼层 |阅读模式
资源类型:行业应用 » 企业管理 . 资源来源:网友投递
来历版块:C/C++
压缩包内文件格式:文本内容
附件来历:互联网
运行方式:Windows方式
是不是经自己验证:是
附件性质:免费
详细说明:《VC++高档编程》
2.3绘图操作终结
下面介绍绘图操作的源程序使您对设备上下文的使用有一个大致的理解。
首要生成一个设备上下文。CPaintDC是MFC提供的一个从CDC承继出来的类。使用它有啥好处呢?假如直接使用CDC的话,我们需要首要调用CWnd的BeginPaint函数为重绘工作做一些准备工作,在终结制作之还要用EndPaint函数表明完毕制作工作。一切的绘图操作都必须在这两个函数之间终结。CPaintDC封装了这两个函数,自动地对它们进行调用,使用者无须再去进行这些调用。
CPaintDCdc(this);
BITMAPbm;
m_bitmap_gt;GetBitmap(bm);
CDCdcImage;
if(!dcImage.CreateCompatibleDC(dc))
return;
CBitmap
pOldBitmap=dcImage.SelectObject(m_bitmap);
dc.BitBlt(0,0,bm.bmWidth,bm.bmHeight,
dcImage,0,0,SRCCOPY);

(Origin section: C/C  
Compressed file format: text content
Attachment source: Internet
Operation mode: Windows mode
Is it verified by yourself: yes
Attachment nature: free
Detailed description: "VC   Advanced Programming"
2.3 The end of the drawing operation
The source program of the drawing operation is introduced below to give you a general understanding of the use of the device context.
First generate a device context. CPaintDC is a class provided by MFC that inherits from CDC. What are the benefits of using it? If we use CDC directly, we need to call the BeginPaint function of CWnd first to do some preparatory work for the redrawing work, and use the EndPaint function to indicate the completion of the production work before the end of the production. All drawing operations must terminate between these two functions. CPaintDC encapsulates these two functions and calls them automatically, and the user does not need to make these calls.
CPaintDCdc(this);
BITMAPbm;
m_bitmap_gt;GetBitmap(bm);
CDCdcImage;
if(!dcImage.CreateCompatibleDC(dc))
return;
CBitmap
pOldBitmap=dcImage.SelectObject(m_bitmap);
dc.BitBlt(0,0,bm.bmWidth,bm.bmHeight,
dcImage,0,0,SRCCOPY);)

[下载]10125954285.rar






上一篇:FPROT源码
下一篇:《C++ Builder高级编程技术》

使用道具 举报

Archiver|手机版|小黑屋|English Version|吾爱开源 |网站地图

Copyright 2011 - 2012 Lnqq.NET.All Rights Reserved

关于本站 - 版权申明 - Ln Studio! - 广告联系

本站资源来自互联网,仅供用户测试使用,相关版权归原作者所有

快速回复 返回顶部 返回列表