CBitmap bitmap;
CDC cdc;
cdc.CreateCompatibleDC(NULL);
bitmap.LoadBitmap(IDB_IMAGE1);
cdc.SelectObject(&bitmap);
CClientDC dc(this);
     dc.BitBlt(0,0,32,32,&cdc,0,0,SRCCOPY);这段程序想来大家太熟悉了,但是我现在的图放在ICON资源里(32*32的图标),而且我要想显示在屏幕上的要是64*64大小.最好有代码!

解决方案 »

  1.   

    CDC::StretchBlt 
    BOOL StretchBlt( int x, int y, int nWidth, int nHeight, CDC* pSrcDC, int xSrc, int ySrc, int nSrcWidth, int nSrcHeight, DWORD dwRop );
      

  2.   

    我当然知道这个,但是,我现在的图象是放在ICON里面,如何生成CBitmap???
      

  3.   

    gz.其实ctrl+c,ctrl+v将icon->bitmap(32*32)中,再用strectchBlt,hehe.
      

  4.   

    OnDraw()
    {
    HICON icon=AfxGetApp()->LoadIcon(IDI_ICON);
    SetIcon(icon,TRUE);
    ::DrawIconEx(dc,32,32,icon,64,64,0,0,DI_IMAGE);///用法msdn
    }
      

  5.   

    http://expert.csdn.net/Expert/topic/1787/1787089.xml?temp=.5944178
    老大。这个是mfc工程。谁能把shines实现了。发我油箱好么?
    [email protected]谢谢了。
      

  6.   

    http://expert.csdn.net/Expert/topic/1787/1787089.xml?temp=.5944178
    老大。这个是mfc工程。谁能把shines实现了。发我油箱好么?
    [email protected]谢谢了。http://expert.csdn.net/Expert/topic/1787/1787089.xml?temp=.4868128
      

  7.   

    CClientDC dc(this);
    CDC cdc;
    cdc.CreateCompatibleDC(&dc);
    cdc.DrawIcon( CPoint(0,0), AfxGetApp()->LoadIcon(ID_10));
    dc.BitBlt(0,0,32,32,&cdc,0,0,SRCCOPY);
    怎么还是不行???
      

  8.   

    dc.bitblt显示cdc选入的bitmap,cdc.selectobjcet无法将ICON选入dc.所以不用
    况且画icon有drawicon函数
    OnDraw(CDC* pDC)

    CClientDC dc(this);
    HICON icon=AfxGetApp()->LoadIcon(IDI_ICON2);//icon 32*32
    dc.DrawIcon(0,0,icon);                      ///drawicon画图标文件
    icon=AfxGetApp()->LoadIcon(IDI_ICON1);      //icon64*64
    ::DrawIconEx(dc,32,32,icon,64,64,0,0,DI_IMAGE);//::drawiconex显示自定义大 小icon
    }