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
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Webbrowser control screen shot - a Challenging task

Webbrowser control screen shot - a Challenging task

Scheduled Pinned Locked Moved C / C++ / MFC
helphostingtutorialquestion
3 Posts 2 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.
  • L Offline
    L Offline
    llp00na
    wrote on last edited by
    #1

    Dear All; I am hosting a microsoft web browser control (assuming it has got a variable: m_webBrowser) on a dialog box. I want to capture a screen shot of the content of the web browser (excluding the main window). Does anyone know or have any idea how to save the content of web browser as an image? I have tried this: RECT rc; HWND hWnd = m_webBrowser.GetSafeHwnd(); ::GetWindowRect (hWnd,&rc); HDC hDC = ::GetDC(0); HDC memDC = ::CreateCompatibleDC ( hDC ); HBITMAP memBM = ::CreateCompatibleBitmap ( hDC, rc.right-rc.left, rc.bottom-rc.top ); ::SelectObject ( memDC, memBM ); ::BitBlt( memDC, 0, 0, rc.right-rc.left, rc.bottom-rc.top , hDC, rc.left, rc.top , SRCCOPY ); But it only saves the visible area of the web browser and not all the content:confused:!!! I will be very gratefull if anyone can help with this problem as it is giving me a real headache X| .

    llp00na

    T 1 Reply Last reply
    0
    • L llp00na

      Dear All; I am hosting a microsoft web browser control (assuming it has got a variable: m_webBrowser) on a dialog box. I want to capture a screen shot of the content of the web browser (excluding the main window). Does anyone know or have any idea how to save the content of web browser as an image? I have tried this: RECT rc; HWND hWnd = m_webBrowser.GetSafeHwnd(); ::GetWindowRect (hWnd,&rc); HDC hDC = ::GetDC(0); HDC memDC = ::CreateCompatibleDC ( hDC ); HBITMAP memBM = ::CreateCompatibleBitmap ( hDC, rc.right-rc.left, rc.bottom-rc.top ); ::SelectObject ( memDC, memBM ); ::BitBlt( memDC, 0, 0, rc.right-rc.left, rc.bottom-rc.top , hDC, rc.left, rc.top , SRCCOPY ); But it only saves the visible area of the web browser and not all the content:confused:!!! I will be very gratefull if anyone can help with this problem as it is giving me a real headache X| .

      llp00na

      T Offline
      T Offline
      Teashirt2
      wrote on last edited by
      #2

      Check out the excellent article http://www.codeproject.com/internet/htmlimagecapture.asp[^]

      L 1 Reply Last reply
      0
      • T Teashirt2

        Check out the excellent article http://www.codeproject.com/internet/htmlimagecapture.asp[^]

        L Offline
        L Offline
        llp00na
        wrote on last edited by
        #3

        I am indeed very gratefull, Thank you very much :)

        llp00na

        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