有个StrecthBlt函数,可是我不知怎么用,在什么时候条用,参数的具体意义等?
我是先吧图片加进了内存,然后让它显示的

解决方案 »

  1.   

    CBitmap  bm;

    bm.LoadBitmap(IDB_BITMAP);     //获得位图

    CDC dcmem;
    dcmem.CreateCompatibleDC(pDC);    //建立内存描述表
    CBitmap  *pOldBm = dcmem.SelectObject(&bm);
    dcmem.SelectObject(bm); pDC->BitBlt(0, 0, 460, 460, 
    &dcmem ,0, 0, SRCCOPY);  //传送位图到设备,这个函数就可以设置大小
    dcmem.SelectObject(pOldBm);
      

  2.   

    在OnDraw或者OnPaint中,用pDC->StrecthBlt(***)绘制。
      

  3.   

    CDC::StretchBlt
    This method copies a bitmap from a source rectangle into a destination rectangle, and stretches or compresses the bitmap to fit the dimensions of the destination rectangle.BOOL StretchBlt (
    int x, 
    int y, 
    int nWidth, 
    int nHeight, 
    CDC* pSrcDC,
    int xSrc, 
    int ySrc, 
    int nSrcWidth, 
    int nSrcHeight, 
    DWORD dwRop ); 具体清查msdn
      

  4.   

    同上,
    int nSrcWidth, 
    int nSrcHeight, int nWidth, 
    int nHeight, 你要想变换长宽,注意以上几个参数就可以了!
      

  5.   

    int x, 
    int y, 
    int nWidth, 
    int nHeight, 
    代表最终显示的起始坐标和尺寸。int xSrc, 
    int ySrc, 
    int nSrcWidth, 
    int nSrcHeight, 
    代表原图片的尺寸。