zoukankan      html  css  js  c++  java
  • MFC中加载位图

    (1)使用BitBlt

    void CBRUSHTESTDlg::OnPaint()
    {
    	CPaintDC dc(this);
    	CBitmap bmp;
    	bmp.LoadBitmap(IDB_BITMAP1);
    	BITMAP bitmap;
    	int size = bmp.GetBitmap(&bitmap);
    	CDC memDC;
    	memDC.CreateCompatibleDC(&dc);
    	memDC.SelectObject(&bmp);
    	dc.BitBlt(10, 10, bitmap.bmWidth, bitmap.bmHeight, &memDC, 0, 0, SRCCOPY);    //向窗口中绘制位图
    }
    

      

     

    (2)使用StretchBlt

    void CBRUSHTESTDlg::OnPaint()
    {
    	CPaintDC dc(this);
    	CBitmap bmp;
    	bmp.LoadBitmap(IDB_BITMAP1);
    	BITMAP bitmap;
    	int size = bmp.GetBitmap(&bitmap);
    	CDC memDC;
    	memDC.CreateCompatibleDC(&dc);
    	memDC.SelectObject(&bmp);
    
    	dc.SetStretchBltMode(STRETCH_HALFTONE);
    	dc.StretchBlt(0, 0, bitmap.bmWidth, bitmap.bmHeight, &memDC, 0, 0, bitmap.bmWidth, bitmap.bmHeight, SRCCOPY);    //向窗口中绘制位图
    }
    

      

      

  • 相关阅读:
    负载均衡session会话保持方法
    PHP分布式中Redis实现Session
    Nginx内置变量
    Nginx配置文件解析
    Nginx重写
    Nginx与Apache比较
    CGI概念
    Linux笔记(十四)
    Linux笔记(十三)
    hdu 4039
  • 原文地址:https://www.cnblogs.com/veis/p/12838159.html
Copyright © 2011-2022 走看看