CSDN首页 空间 新闻 论坛 Blog 下载 读书 网摘 搜索 .NET Java 视频 接项目 求职 在线学习 买书 程序员 通知
可用分押宝游戏火热进行中... 专题改版:Java Web 专题
CSDN社区
搜索 收藏 打印 关闭
CSDN社区 >  VC/MFC >  基础类

如何将图片加载入记忆体且如何将在记忆体内的图片show在视图上

楼主babaly(張小政)2004-08-01 01:40:15 在 VC/MFC / 基础类 提问

如何将图片加载入记忆体  
  且如何将在记忆体内的图片  
  show在视图上  
  请问大侠们要怎实现呢??  
  谁可以提供程序让我学习… 问题点数:0、回复次数:2Top

1 楼tbwisess(精武门)回复于 2004-08-01 09:31:10 得分 0

//从书上抄的,不知道符合楼主要求不,我也是刚学   :)  
  void   CBkGroundMapView::OnDraw(CDC*   pDC)  
  {  
  CBkGroundMapDoc*   pDoc=Getdocument();  
  ASSERT_VALID(pDoc);  
  CBitmap   Bitmap;  
  Bitmap.LoadBitmap(IDB_BITMAP);  
  CDC   MemDC;  
  MemDC.CreateCompatibleDC(pDC);  
  CBitmap*   pOldBitmap=MemDC.SeletObject(&Bitmap);  
  BITMAP   bmap;  
  Bitmap.GetObject(sizeof(BITMAP),&bmap);  
  pDC->BitBlt(0,0,bmap.bmWidth,bmap.bmHeight,&MemDC,0,0,SRCCOPY);  
  MemDC.SelectObject(pOldBitmap);  
  } Top

2 楼tbwisess(精武门)回复于 2004-08-01 09:37:40 得分 0

/////////////////////////////////////////////////////////////////////  
  Creates   a   memory   device   context   that   is   compatible   with   the   device   specified   by   pDC.  
   
  BOOL   CreateCompatibleDC(  
        CDC*   pDC    
  );  
   
  ////////////////////////////////////////////////////////////////////  
  Copies   a   bitmap   from   the   source   device   context   to   this   current   device   context.  
   
  BOOL   BitBlt(  
        int   x,  
        int   y,  
        int   nWidth,  
        int   nHeight,  
        CDC*   pSrcDC,  
        int   xSrc,  
        int   ySrc,  
        DWORD   dwRop    
  );  
  Parameters  
  x    
  Specifies   the   logical   x-coordinate   of   the   upper-left   corner   of   the   destination   rectangle.    
  y    
  Specifies   the   logical   y-coordinate   of   the   upper-left   corner   of   the   destination   rectangle.    
  nWidth    
  Specifies   the   width   (in   logical   units)   of   the   destination   rectangle   and   source   bitmap.    
  nHeight    
  Specifies   the   height   (in   logical   units)   of   the   destination   rectangle   and   source   bitmap.    
  pSrcDC    
  Pointer   to   a   CDC   object   that   identifies   the   device   context   from   which   the   bitmap   will   be   copied.   It   must   be   NULL   if   dwRop   specifies   a   raster   operation   that   does   not   include   a   source.    
  xSrc    
  Specifies   the   logical   x-coordinate   of   the   upper-left   corner   of   the   source   bitmap.    
  ySrc    
  Specifies   the   logical   y-coordinate   of   the   upper-left   corner   of   the   source   bitmap.    
  dwRop    
  Specifies   the   raster   operation   to   be   performed.   Raster-operation   codes   define   how   the   GDI   combines   colors   in   output   operations   that   involve   a   current   brush,   a   possible   source   bitmap,   and   a   destination   bitmap.   See   BitBlt   in   the   Platform   SDK   for   a   list   of   the   raster-operation   codes   for   dwRop   and   their   descriptions    
  Top

相关问题

  • 视图
  • 视图
  • 视图
  • 视图切分
  • 还是视图
  • 关于视图
  • SQL视图
  • 视图问题。
  • 视图问题
  • 嵌入视图

关键词

  • bmap
  • 图片
  • memdc
  • bitmap
  • pdc
  • cdc
  • device context

得分解答快速导航

  • 帖主:babaly

相关链接

  • Visual C++类图书
  • Visual C++类源码下载

广告也精彩

反馈

请通过下述方式给我们反馈
反馈
提问
网站简介|广告服务|VIP资费标准|银行汇款帐号|网站地图|帮助|联系方式|诚聘英才|English|问题报告
世纪乐知(北京)网络技术有限公司 版权所有, 京 ICP 证 020026 号
北京创新乐知广告有限公司 提供技术支持
Copyright © 2000-2007, CSDN.NET, All Rights Reserved
GongshangLogo