高校计算机

3773考试网计算机等级考试高校计算机正文

VC实现JPG图片加载

来源:fjzsksw.com 2009-11-4 10:37:54

CRect rect;

  GetClientRect(rect);

  fX=rect.Width();

  fY=rect.Height();

  //fX   =   (double)pDC->GetDeviceCaps(HORZRES)*(double)hmWidth/((double)pDC->GetDeviceCaps(HORZSIZE)*100.0);

  //fY   =   (double)pDC->GetDeviceCaps(VERTRES)*(double)hmHeight/((double)pDC->GetDeviceCaps(VERTSIZE)*100.0);

  if(FAILED(pPic->Render(*pDC,0,0,(DWORD)fX,(DWORD)fY,0,hmHeight,hmWidth,-hmHeight,NULL))) AfxMessageBox("Failed   To   Render   The   picture!");

  pPic->Release();

  }

  else

  AfxMessageBox("Error   Loading   Picture   From   Stream!");

  }

  }

  }

  else

  AfxMessageBox("Can't   Open   Image   File!");

上一页  [1] [2] 

触屏版 电脑版
3773考试网 琼ICP备12003406号-1