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. [Win32] How compare two image

[Win32] How compare two image

Scheduled Pinned Locked Moved C / C++ / MFC
question
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.
  • M Offline
    M Offline
    Member 2965471
    wrote on last edited by
    #1

    I have to develop an application that captures a portion of the desktop every 30 seconds, after viewing the captured image in the window of application, should find (and then highlight) which regions of the new image have changed compared to the previous image. Ok, so:

    HDC memDC;
    memDC = CreateCompatibleDC( GetDC(hWnd) );

    WM_TIMER:
    InvalidateRect(...)

    WM_PAINT:
    hdc = BeginPaint(...);
    screenDC = GetDC(0);

    hBmp = CreateCompatibleBitmap(hdc, nWidth, nHeight );
    hPrevBmp = SelectObject(memDC,hBmp);

    BitBlt(memDC, ..., screenDC, ...);
    BitBlt(hdc, ..., memDC, ...);

    How can i compare the two image?

    D 1 Reply Last reply
    0
    • M Member 2965471

      I have to develop an application that captures a portion of the desktop every 30 seconds, after viewing the captured image in the window of application, should find (and then highlight) which regions of the new image have changed compared to the previous image. Ok, so:

      HDC memDC;
      memDC = CreateCompatibleDC( GetDC(hWnd) );

      WM_TIMER:
      InvalidateRect(...)

      WM_PAINT:
      hdc = BeginPaint(...);
      screenDC = GetDC(0);

      hBmp = CreateCompatibleBitmap(hdc, nWidth, nHeight );
      hPrevBmp = SelectObject(memDC,hBmp);

      BitBlt(memDC, ..., screenDC, ...);
      BitBlt(hdc, ..., memDC, ...);

      How can i compare the two image?

      D Offline
      D Offline
      David Crow
      wrote on last edited by
      #2

      Member 2965471 wrote:

      How can i compare the two image?

      Read here.

      "One man's wage rise is another man's price increase." - Harold Wilson

      "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

      "Some people are making such thorough preparation for rainy days that they aren't enjoying today's sunshine." - William Feather

      M 1 Reply Last reply
      0
      • D David Crow

        Member 2965471 wrote:

        How can i compare the two image?

        Read here.

        "One man's wage rise is another man's price increase." - Harold Wilson

        "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

        "Some people are making such thorough preparation for rainy days that they aren't enjoying today's sunshine." - William Feather

        M Offline
        M Offline
        Member 2965471
        wrote on last edited by
        #3

        I've only understand i've to perform a XORing operation between the two image, but how can i do that? and then how can i highlight rectangular region modified? using GetPixel?

        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