Archived

This topic is now archived and is closed to further replies.

jbattist

Screen scraping

Recommended Posts

jbattist    122
How do I grab a rect of a window and get the data in the rect as a bitmap? I want to see if a certain bitmap is on the screen so I guess I''ll have to compare it bit for bit?

Share this post


Link to post
Share on other sites
Lestat3D    122
JAJAJA!! you''re a newbie, aren''t you?
you have to make a structure or variable that store the current bitmap loaded, and then you have just to check that structure or variable to know which bitmap is the currently showed.

Share this post


Link to post
Share on other sites
jbattist    122
Yeah, I guess I''m a newbie at Windows GDI bitmap grabbing.

I''ve got a DC to the window I want to grab rects from, do I just use BitBlt to copy that rect to a new in memory bitmap? From the memory DC, how do you read the bitmap data bit for bit?

Share this post


Link to post
Share on other sites
defster    122
I''m not sure what you mean. You want to check to see if a window is within the boundaries of the screen? You dont need to store a bitmap to find that out.

As for your question. If you want to blit your WHOLE window into a bitmap, i think someone else has to help. Blitting (using the windows DC) will only blit the contents of the window, not the borders and menu-bar and all that. If you have a borderless window, you''re fine.

Checking bit by bit to see if the bitmap is off the screen sounds slightly over-complicated. Just compare the boundaries to the main screen and see if its outside. Maybe you should explain a bit better

defster

Share this post


Link to post
Share on other sites
jbattist    122
I''m writing a Minesweeper solver. So I want to grab the minesweeper window DC, grab the playing area to a butmap and start sending keystrokes down to solve the puzzle.

Share this post


Link to post
Share on other sites