How to change a pixel color with out using SetPixel() function

Hi,
        How can I change the Pixel color of our window DC with out using the function SetPixel() function
in Vc++, I am searching for a method for getting the direct pointer address of our window DC location.
So I can change the RGB value using memory address (Pointer)
inampudi1Asked:
Who is Participating?
 
ZoppoCommented:
Hi inampudi,

IMO direct access to pixel's RGB values of a window's DC is not possible. For example see this discussion: http://discuss.joelonsoftware.com/default.asp?joel.3.674212.14

You can create a memory device context (CreateCompatibleDC). For this you can create DIB (i.e. CreateDIBSection) and access the pixels there - then use BitBlt to draw this bitmap to the window ...

Hope that helps,

ZOPPO

0
 
inampudi1Author Commented:
Hi experts,
                      can We create a DIB which will automatically refresh to the DC with out calling BitBlt or StretchBlt etc like functions . Because i want a very fast method. Is BitBlt() copy the entire image to the DC or Just set The pointer.Or is there any method to directly set out DIB pointer to our Window DC.
0
 
ZoppoCommented:
Hi again,

no, IMO you can't do anything else than blitting the bitmap to the real DC (at least not in Windows GDI) - the problem simply is you would need to have access to the graphics-card's memory which is blocked - the only way to achive such things would be to use DirectX/DirectDraw. Anyway, how fast do you want to have it? BitBlt isn't such slow - for example I once wrote a bitmap roation test program which managed to rotate and paint a 800x600 pixel image on a 2,4 GHz machine with about 160 fps.

BitBlt copies the image (or a part of it) to the real DC ...

ZOPPO
0
 
inampudi1Author Commented:
HI Zoppo,
                     Your Guidance is Good, it is well cleared..
And it is very helpfull to me...
0
 
ZoppoCommented:
That's fine, I'm glad I could help ...

Have a nice day,

best regards,

ZOPPO
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.