Getting a pixel from a window
You can check out my MVP Tips site for some interesting essays. They
are not FAQs, and there's only a couple dozen. However, doing a FAQ
for every newbie question would generate a FAQ file as long as the
MSDN documentation, and you wouldn't want to download it.
GetPixel is the answer that will probably work. Note the careful
wording. The performance could be so abysmal that you may want some
other means. Without knowing the nature of your problem, performance
constraints, size of bitmap, etc. it is hard to determine what the
answer is. It is not obvious, btw, that you want to do this in a mouse
handler--there's lots of reasons to get pixels from views or screens.
But your reason, as given, suggests you want to display it, such as in
the status bar or someplace, and GetPixel performance is probably
adequate for this purpose.
>First of all, I've had enough of asking really basic questions
>and wasting your time in the process of replying. Doesn't
>there exist an FAQ with all the most obvious VC++ questions the
>beginner VC++ programmer is likely to make ? (how do you load
>a bitmap on screen, how do you refresh a window, how do you allow
>for different child documents etc).
>Just in case there isn't ...
>How do I extract the colour of a pixel, say (25,45), from
>an MDI child. I obviously want to do this in a mouse handler.
>Sent via Deja.com http://www.deja.com/
>Before you buy.
Joseph M. Newcomer [MVP]
MVP Tips: http://www3.pgh.net/~newcomer/mvp_tips.htm