Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Why slower draws on Screen with HW Accel. set to FULL?

Why slower draws on Screen with HW Accel. set to FULL?

Scheduled Pinned Locked Moved C / C++ / MFC
c++graphicsquestionhardwarehelp
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • U Offline
    U Offline
    uus99
    wrote on last edited by
    #1

    I have a question regarding Slow StretchBlt when Video Full Hardware Acceleration is Enabled in WIndows XP. Here is my computer's spec, (also on a Dell P4 2gHz) AMD AthlonXP 2000+ 512MB DDR266 WD 7200 40GB HD +8MB Cache GeForce 4MX 440 64MB AGP 4x Windows XP+SP1a+All current updates Visual C++ 6 +SP5 I have noticed that when i switch off HW Acceleration that is set to NONE (Display Prop>Advanced>Troubleshoot>Video HW Acceleration>None) i get faster drawing on screen with StretchBlt upto 4-6times faster. When i switch HW Acceleration to FULL, the drawing becomes slower. Here is a sample code that opens a CAPTURE.bmp file of 360x360 pixel and StretchBlts to screen. //------------------------------------------------------- void CSlowBltDlg::OnOK() { //timer CElapsed m_el; CDC memDCLoad; CDC *pDC; CBitmap m_bmpBitmap; pDC = this->GetDC(); int x_width=360; int y_height=360; pDC->SetStretchBltMode(COLORONCOLOR); LoadBitmap(this,&memDCLoad); //start timer m_el.Begin(); pDC->StretchBlt(20,30,200,200,&memDCLoad,0,0,x_width,y_height,SRCCOPY); //end timer and show on screen m_el.End(); CString szTime; szTime.Format("Time = %.3fms", m_el.m_dElapsed*1000); pDC->TextOut(10, 10, szTime); } void LoadBitmap(CSlowBltDlg *myDlg, CDC *memDCLoad) { CDC *pDC; CBitmap m_bmpBitmap; pDC = myDlg->GetDC(); CString m_sBitmap; memDCLoad->CreateCompatibleDC(pDC); static char BASED_CODE szFilter[] = "Bitmap Files (*.bmp)|*.bmp||"; // Create the File Open Dialog CFileDialog m_ldFile(TRUE, "*.bmp", m_sBitmap, OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT, szFilter); if (m_ldFile.DoModal() == IDOK) { m_sBitmap = m_ldFile.GetPathName(); HBITMAP hBitmap =(HBITMAP)::LoadImage(AfxGetInstanceHandle(),m_sBitmap,IMAGE_BITMAP,0,0, LR_LOADFROMFILE|LR_DEFAULTCOLOR); if(hBitmap) { if(m_bmpBitmap.DeleteObject()) m_bmpBitmap.Detach(); m_bmpBitmap.Attach(hBitmap); } memDCLoad->SelectObject(&m_bmpBitmap); } } //Timing requires CElapsed class available in zip file.. see below //------------------------------------------------------- With HW Acc. Full= 6.01ms With HW Acc. None= 0.8ms Isnt HW Acc. supposed to make drawing faster? Please comment. I am doing a realtime image processing program and time is crucial. My current program StretchBlts with other processing takes 252ms per frame of an image captured from somewhere (360x360 px) on a Dell Pentium 4 2Ghz with ATI Rage 64

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups