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. Regarding Screen changes

Regarding Screen changes

Scheduled Pinned Locked Moved C / C++ / MFC
questionc++
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.
  • S Offline
    S Offline
    santosh k
    wrote on last edited by
    #1

    Hi, Iam Using VC++, Iam planning to capture the screen, saving into .BMP format and iam able to do this. My question is I want to capture the screen whenever the changes happen on my desktop. Can any one tell me how do i know whether the screen changed or not. i mean through which event we can find it out. Thanks in Advance. Regards Santosh.K

    L 2 Replies Last reply
    0
    • S santosh k

      Hi, Iam Using VC++, Iam planning to capture the screen, saving into .BMP format and iam able to do this. My question is I want to capture the screen whenever the changes happen on my desktop. Can any one tell me how do i know whether the screen changed or not. i mean through which event we can find it out. Thanks in Advance. Regards Santosh.K

      L Offline
      L Offline
      Luuk Weltevreden
      wrote on last edited by
      #2

      If you wish to capture the screen when even a single pixel has changed you'll have an impossible time finding an event which triggers that. Suppose you have a movie running on the screen. The screen changed but probably not a single message is called. In this case your best bet would be to keep capturing the screen on a certain interval and comparing the bitmaps in memory. This would be really slowing down your system though. If you don't mind much about movies and the like and wish to recapture only when a window for instance resizes or gets created you could make a global windows hook. A CBT hook would be quite good for this purpose I guess. From the MSDN: The system calls this function before activating, creating, destroying, minimizing, maximizing, moving, or sizing a window; before completing a system command; before removing a mouse or keyboard event from the system message queue; before setting the keyboard focus; or before synchronizing with the system message queue.

      1 Reply Last reply
      0
      • S santosh k

        Hi, Iam Using VC++, Iam planning to capture the screen, saving into .BMP format and iam able to do this. My question is I want to capture the screen whenever the changes happen on my desktop. Can any one tell me how do i know whether the screen changed or not. i mean through which event we can find it out. Thanks in Advance. Regards Santosh.K

        L Offline
        L Offline
        Luuk Weltevreden
        wrote on last edited by
        #3

        The best thing you can do in this case I guess is to capture the screen at a static interval. You can do three things (which I can think of atleast :)): 1) Just capture the screen at a static interval and write it to the disk as bitmap 2) Capture the screen at a static interval and write it to the disk as a compressed image 3) Capture the screen and compare it to the last to see if it changed and write it to the disk if it didn't (this means that you'll also have to keep a log on how long the same image should be shown) Depending on the desired framerate and quality of the final movie (and ofcourse speed of the machine) I can't do nothing but suggest you to find the best and fastest way for yourself. They all have disadvantages, the first two being a high I/O and the second a lot of CPU required. The third, well I don't know about performance in the third. It seems like it could be pretty fast compared to the other two, but it's just a hunch :) I think though that if you want the best performance this should be done in assembly, especially with method 2 and 3. And I was just thinking. Suppose you have a resolution of 1024x768, 16 bits and you wish to have a framerate of 24. This means that with method 1 you'll have to write about 40MB/s to the harddisk. It's going to have a very hard time doing that and the harddisk will need quite some space too :) If I were you I'd try my last suggestion, it sure seems like the most fun suggestion as well :)

        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